syntax error in numbers

I keep getting a syntax error in numbers and would so appreciate help! The formula is: IF(V1279−V1278>0,V1279−V1278<12),IF(DUR2DAYS(D1279−D1278=1),1,0) . The D column is a date and the requirement I am trying to get is that D1279 is the day after D1278.

MacBook Pro 15″, macOS 10.14

Posted on Jul 27, 2021 4:06 PM

Reply
Question marked as Top-ranking reply

Posted on Jul 27, 2021 6:54 PM

I did not test the formula given below. At best it works correctly. At worst it shows you what you need to do. You need the AND function. Your description of the problem has the clue. You want to identify when "column V is more than zero and less than 12 than the number in the prior row of column V and also are just one day later


=IF(AND(V1279-V1278>0,V1279-V1278<12, DUR2DAYS(D1279-D1278)=1),1,0)


If you want a TRUE/FALSE result vs 1/0 you can simplify it to this (no IF required)

=AND(V1279-V1278>0,V1279-V1278<12, DUR2DAYS(D1279-D1278)=1)

6 replies
Question marked as Top-ranking reply

Jul 27, 2021 6:54 PM in response to amyniac

I did not test the formula given below. At best it works correctly. At worst it shows you what you need to do. You need the AND function. Your description of the problem has the clue. You want to identify when "column V is more than zero and less than 12 than the number in the prior row of column V and also are just one day later


=IF(AND(V1279-V1278>0,V1279-V1278<12, DUR2DAYS(D1279-D1278)=1),1,0)


If you want a TRUE/FALSE result vs 1/0 you can simplify it to this (no IF required)

=AND(V1279-V1278>0,V1279-V1278<12, DUR2DAYS(D1279-D1278)=1)

Jul 27, 2021 5:17 PM in response to amyniac

Your parentheses are unbalanced.


IF(V1279−V1278>0,V1279−V1278<12),IF(DUR2DAYS(D1279−D1278=1),1,0)


The format for the IF() command is:

IF ( <test_expression>, <do_this_if_true>, <do_this_if_false> )


In your case, test_expression (everything up to the first ,) is:


V1279−V1278>0


IF this evaluates to true, it runs everything past the comma:


V1279−V1278<12


If the test_expression evaluates to false, it runs everything after the true_statement, which is where it breaks:


IF(DUR2DAYS(D1279−D1278=1),1,0


Without knowing what your expectation is, it's hard to tell you how to correct it, but as written the syntax doesn't fly.


Jul 27, 2021 6:59 PM in response to amyniac

amyniac wrote:

I am trying to identify which cells in column V are more than zero and less than 12 than the number in the prior row of column V and also are just one day later.


I think this does what you describe:



In W3, copied or filled down:


=IF(AND(DUR2DAYS(D3−D2)=1,AND(V3−V2>0,V3−V2≤12)),TRUE,FALSE)


SG


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

syntax error in numbers

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.