Jesus 'n Jim
A mainly PC (some Mac) site w/Software, Computer Repair Info, How-To's on Using Computers
Technical Support 1-360-521-2060 (my business line cell)

conditional functions - if()

 

one really useful little function you may not have heard much about which is used in programming a lot is the if-then-else statement. It boils down to "if condition is true, do the then statement otherwise do the else statement." If you decide to do VBA programming in Excel or Word, you might need this. This statement has been ported over to Excel with the if() function. It's really easier than I explained it.

IF(condition,value-if-true)

a value can be "text within double-quotes" or it can be a number or it can be a formula or a function or it can be TRUE() or FALSE(), which both happen to be functions. If you want to use A5*10+A6*20.9/C7*MIN(E1:F10) for a value you can do that. for contitions, you have AND(), OR(), FALSE(), NOT(), OR(), TRUE(). AND() and OR() can have a list of values between the perentheses separated by commas. Think of the possibilities!

IF(condition,value-if-true,value-if-false)

an example for a check reconciliation spreadsheet I made uses this function: =IF(A5=0,"Reconciled!----------","Not Reconciled--------")

Nested IFs

you can nest them too, meaning that since IF is a function, you can place an IF inside another IF statement, such as in the else (value-if-false) or the then (value-if-true). But it can get tricky with the perentheses! let me give you an example with price breaks using the else clause: =IF(A2<50,12.00,IF(AND(A2>=50,A2<500),10.21,IF(AND(A2>=1000,A2<10000),7.00,"==CALL==")))