Apple Numbers. Using the IF formula to display a String if a number is greater than another number but less than another number.

Hello,


I am trying to create a formula that displays "First" when the condition is true and "Second" when the condition is false. The formula is as follows IF ((5>1 and 5<15), "First", "Second"). I however am unsure of how to write this type of formula in the Numbers app on Mac.

Posted on Aug 18, 2022 11:10 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 18, 2022 11:17 AM

It helps to break down the logic behind it:


AND() is a function unto itself, which compares two conditional statements and returns TRUE or FALSE, accordingly.


So to check if two conditions are true:


AND (D2 > 5, E2 < 15)


this will compared the values in cells D2 and E2 and return TRUE or FALSE.


This can then be plugged into your IF() statement to determine which final value to output:


IF(AND(D2>5,E2<12),"First", "Second")


So, following the parentheses, the AND() statement is run first, then depending on the result, the IF() statement selects the appropriate result.

2 replies
Question marked as Top-ranking reply

Aug 18, 2022 11:17 AM in response to ramsbr001

It helps to break down the logic behind it:


AND() is a function unto itself, which compares two conditional statements and returns TRUE or FALSE, accordingly.


So to check if two conditions are true:


AND (D2 > 5, E2 < 15)


this will compared the values in cells D2 and E2 and return TRUE or FALSE.


This can then be plugged into your IF() statement to determine which final value to output:


IF(AND(D2>5,E2<12),"First", "Second")


So, following the parentheses, the AND() statement is run first, then depending on the result, the IF() statement selects the appropriate result.

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.

Apple Numbers. Using the IF formula to display a String if a number is greater than another number but less than another number.

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