keep getting syntax error with IF & AND statement
Here’s my attempt at a ‘simple’ IF statement which only results in SYNTAX error:
IF(AND(B3>5.6, B3<6.6), “true”, “false”)
What am I doing wrong?!
iPhone 8 Plus
Here’s my attempt at a ‘simple’ IF statement which only results in SYNTAX error:
IF(AND(B3>5.6, B3<6.6), “true”, “false”)
What am I doing wrong?!
iPhone 8 Plus
Thank you for responding.
Yes the true/false are examples. Not sure of regional settings being the U.S. I’ve always prior used the commas…
I indeed want a text response for true (which I have 3 more variations of this statement to do), and for false it could simply be an empty response. Any further ideas regarding my syntax error?
Hi Craig,
It looks like you are using Numbers > Settings > General > Cell References: > Use header names as labels.
The formula that you pasted in your reply contains smart quotes:
IF(AND(Reading '6/24/2023 12:47 PM'>5.6,Reading '6/24/2023 12:47 PM'<6.6)”Acidic”,”N/A”)
Formula in C2:
IF(AND(Reading '24 Jun 2023 12:00 am'>5.6,Reading '24 Jun 2023 12:00 am'<6.6),"Acidic","N/A")
Regards,
Ian.
The function is fine here. Was this just an example? I ask because I don't know why you put TRUE and FALSE in quotes, unless they are standing in for something else or you needed them to be text. If TRUE/FALSE are the desired results, a simpler formula is =AND(B3>5.6, B3<6.6).
But back to the problem: If your function is giving you a syntax error, one common reason is regional. If your computer is set to a region that uses a comma as a decimal separator, the parameters in functions are separated by semicolons, not commas. And if this is the case for you, 5.6 and 6.6 would need to be 5,6 and 6,6.
=IF(AND(B3>5,6; B3<6,6); TRUE; FALSE)
If that is not it, did you copy/paste the exact formula from your spreadsheet to your post or did you retype it? If retyped, maybe you fixed the problem when you typed it in here.
I copy/pasted your formula from your post to a spreadsheet and it worked correctly. That is why I asked if you had copy/pasted it from your spreadsheet to your post vs retyping it. If you retyped it here, copy/paste it from your post to your spreadsheet and that might fix it.
Interesting, I did retype it as the paste looked odd, created on iOS iPhone 8plus…
The copy/paste is below:
IF(AND(Reading '6/24/2023 12:47 PM'>5.6,Reading '6/24/2023 12:47 PM'<6.6)”Acidic”,”N/A”)
Do you see anything that would trigger the error?
Thanks,
Craig
Yes. After the <6.6) you need a comma
Bro, that was it! I swear I tried those variations, but clearly I didn’t do it properly. Thank you very much for your time and effort!
Thank you very much for catching that! Normally I would do that, but I was trying to do the quick & dirty route. I will go back in and do it proper…
keep getting syntax error with IF & AND statement