Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Creating a simple IF-THEN formula

I'm almost embarrassed to ask this, but I have searched the "iWork Formula and Function Help" in vain, and any similar questions asked in these forums are complex and really unrelated to what I need to do. What is the basic syntax for an IF-THEN formula in Numbers 09?


For example: I want one cell to show the sum of two other cells, but if that sum is over a certain limit, I want it to show the limit. In other words I want to tell Numbers something like this: "If C1 plus C2 are less than 24, enter the sum of C1 plus C2. If their sum is more than 24, enter 24." I've been looking for two hours now, and I simply cannot find anything that gives me the basic syntax to such a statement, certainly not in "iWork Formula and Function Help." Please help if you can. Thanks.

MacBook Pro, Mac OS X (10.6.8)

Posted on May 7, 2012 1:13 PM

Reply
Question marked as Best reply

Posted on May 7, 2012 1:39 PM

Building a little on what Wayne gave you, the actual syntax is basically the following:


IF( <some test that will result in a true or false>, <What to do if the test is true>, <What to do if False>)


The test is going to -almost- always going to include a cell reference and comparison sign, like A2=2 or like in Waynes above (C1+C2)<25.


The place to put what you would want if True or False contains the equation (note that it's without the equal sign). But it is the actual equation you would have typed by hand.


so in Waynes example (formatted with the areas with similar formatting to help you see where each part matches up):

IF( <some test that will result in a true or false>, <What to do if the test is true>, <What to do if False>)

IF((C1+C2)<25, C1+C2, 24)



Jason

20 replies
Question marked as Best reply

May 7, 2012 1:39 PM in response to NDeanM

Building a little on what Wayne gave you, the actual syntax is basically the following:


IF( <some test that will result in a true or false>, <What to do if the test is true>, <What to do if False>)


The test is going to -almost- always going to include a cell reference and comparison sign, like A2=2 or like in Waynes above (C1+C2)<25.


The place to put what you would want if True or False contains the equation (note that it's without the equal sign). But it is the actual equation you would have typed by hand.


so in Waynes example (formatted with the areas with similar formatting to help you see where each part matches up):

IF( <some test that will result in a true or false>, <What to do if the test is true>, <What to do if False>)

IF((C1+C2)<25, C1+C2, 24)



Jason

May 7, 2012 6:03 PM in response to NDeanM

Hi Dean,


IF, and all the rest of the functions supported by the iWork applications, is defined and discussed in the iWork Formulas and Functions User Guide. A search for IF brings up a huge number of hits, of course ("if" is a very common word in this guide), but the one pointing to the Table of contents entry (on page 6) is third on the list, and not very hard to spot.

User uploaded file

Clicking that will take you to the contents page section listing the Logical and Information functions, where clicking on the IF entry will take you to the article on this function, where you'll find a description, a statement of the syntax (not quite as easy to read as Jason's version), and an example or two of how to use the function.


For individual functions, though you might want to skip the search and go straight to the contents pages' list of functions, grouped by type. Starting there will point you to the page describing the function you're looking for AND show you some others you might not have considered.


Or you could use the Function Browser (without even leaving numbers). Click the yellow Function button in the Toolbar and choose Show Function Browser. Type the name (or part of the name) of the function you want in the search box. You'll get a list of all the functions that include the letter string you typed, plus other functions whose purpose is similar in some way. Select one, and the bottom part of the browser window gives you a description, including the syntax, for that function.

User uploaded file

Click Insert Function and the browser inserts the function, with its syntax shown, into the selected cell. Click each segment in turn and write that part in.

User uploaded file

One thing that search would not have produced in this case, though, is the suggestion made by Wayne to use MIN instead of IF. For the result you want, MIN makes much more sense than IF, so I'd second Wayne's proposed formula.


Regards,

Barry

Aug 22, 2013 11:45 AM in response to NDeanM

Hi there!

I lost about 3 hours and I was really getting MAD with Apple Numbers 09

I'm not an advance user of Numbers 09, but I'm not a beginner either.

I have used formulas before with o problem.

I was trying to use formulas with function "IF" copying exactly as Apple examples but I always get "syntax error".

I have quitted the Application and started it again, started a spreadsheet from scratch, and I've restarted the computer and always get the same error.

I have tried the simple example presented in this discussion and also I get "Syntax error".

I was really getting MAD!

Incidentally I saw Barry post and clicked "Insert Function" in the "Formula Editor" and noticed a minor error syntax that I could have not resolve in spite my internet search: In all the places I have searched, including Apple Official Support pages (and Numbers Manual and Numbers Help) the separators of the conditions were comas ","


=IF(if-expression,if-true,f-false)


but my application only accept semicolon


=IF(if-expression;if-true;if-false)


Why is that?


Pedro

Aug 22, 2013 4:10 PM in response to Jerrold Green1

Jerry:


Thank you very much for your replay

I have the "Numbers '09 User Guide" in Portuguese and as far as I'm concerned nothing is said about this.

In fact all the examples use coma "," as the argument delimiter and assume that "." is the decimal delimiter.

But it is true that my System Preferences is set to use coma "," as the decimal separator.

I would expect a warning for this matter or a standardized semicolon ";" as the universal argument delimiter.

Fortunately, after 3 lost hours, I've managed to format the cells as I wanted.

Best regards:


Pedro Cavilhas

Lisboa, Portugal

Creating a simple IF-THEN formula

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