MacMusic  |  PcMusic  |  440 Software  |  440 Forums  |  440TV  |  Zicos
len
Search

How Do I Know If a Number Is a Palindrome Using a Formula In Numbers?

Saturday September 18, 2021. 01:37 AM , from MacMost
Normally I use Google Sheets, but I recently switched to a MacBook and want to use Numbers instead of Google Sheets.
I want to use a formula to see if a number is a palindrome. In Google Sheets I have 2 formulas that work, but they don’t work or don’t work well in Numbers.
In column A is the date and time as epoch timestamp. For example 17 September 2021 15:16:16 is 1631891776. The formula is in column B.
Formula 1:
IF(SUMPRODUCT(−−MID(SUBSTITUTE(A1;” “;””);ROW(INDIRECT(“1:”&LEN(SUBSTITUTE(A1;” “;””))));1)=MID(SUBSTITUTE(A1;” “;””);LEN(SUBSTITUTE(A1;” “;””))+1−ROW(INDIRECT(“1:”&LEN(SUBSTITUTE(A1;” “;””))));1))=LEN(SUBSTITUTE(A1;” “;””));”yes”;”no”)
This formula doesn’t give a result, but I get the following notification: The function “SUMPRODUCT” expects a vector but found “FALSE”.
If I take the formula apart I get the following answers:
SUMPRODUCT−−MID(SUBSTITUTE(A1;” “;””);ROW(INDIRECT(“1:”&LEN(SUBSTITUTE(A1;” “;””))));1)=MID(SUBSTITUTE(A1;” “;””);LEN(SUBSTITUTE(A1;” “;””))+1−ROW(INDIRECT(“1:”&LEN(SUBSTITUTE(A1;” “;””))));1) = here I get the notification
−−MID(SUBSTITUTE(A1;” “;””);ROW(INDIRECT(“1:”&LEN(SUBSTITUTE(A1;” “;””))));1)=MID(SUBSTITUTE(A1;” “;””);LEN(SUBSTITUTE(A1;” “;””))+1−ROW(INDIRECT(“1:”&LEN(SUBSTITUTE(A1;” “;””))));1) = FALSE
MID(SUBSTITUTE(A1;” “;””);ROW(INDIRECT(“1:”&LEN(SUBSTITUTE(A1;” “;””))));1) = 1
MID(SUBSTITUTE(A1;” “;””);LEN(SUBSTITUTE(A1;” “;””))+1−ROW(INDIRECT(“1:”&LEN(SUBSTITUTE(A1;” “;””))));1) = 6
LEN(SUBSTITUTE(A1;” “;””)) = 10
Formula 2:
IF(SUMPRODUCT((MID(A1;ROW(OFFSET($A$1;;;LEN(A1)));1)=MID(A1;LEN(A1)−ROW(OFFSET($A$1;;;LEN(A1)))+1;1))+0)=LEN(A1);”yes”;”no”)
With this formula I get “no” with every number and there is a blue triangle in the top left corner of the cell with the message: The formula uses a Boolean in place of a number.
If I take the formula apart I get the following answers:
SUMPRODUCT((MID(A1;ROW(OFFSET($A$1;;;LEN(A1)));1)=MID(A1;LEN(A1)−ROW(OFFSET($A$1;;;LEN(A1)))+1;1))+0) = 0 (here I get the blue triangle)
MID(A1;ROW(OFFSET($A$1;;;LEN(A1)));1) = 1
MID(A1;LEN(A1)−ROW(OFFSET($A$1;;;LEN(A1)))+1;1) = 6
LEN(A1) = 10
When I change the number 1631891776 to 1631881361, then the answers 6 in both formulas changes to 1, and in formula 2 the answer 0 changes to 1. But the answer from the IF formula doesn’t change.
How can I fix this?
Thanks in advance.
We want to know if the epoch timestamp is a palindrome, prime or palinprime number. These are numbers that don’t come up often. We are in a rabbit hole of decoding the epoch timestamp for a project. We think that a combination of these numbers is a key to unlocking the map.
—–
Taya
https://macmost.com/forum-how-do-i-know-if-a-number-is-a-palindrome-using-a-formula-in-numbers.html
News copyright owned by their original publishers | Copyright © 2004 - 2024 Zicos / 440Network
Current Date
Apr, Thu 18 - 10:13 CEST