Вы находитесь на странице: 1из 18

MS EXCEL - IF FUNCTION

Show All

Returns one value if a condition you specify evaluates to TRUE and another value if it evaluates to FALSE. Use IF to conduct conditional tests on values and formulas. Syntax IF(logical_test,value_if_true,value_if_false) Logical_test is any value or expression that can be evaluated to TRUE or FALSE. For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100, the expression evaluates to TRUE. Otherwise, the expression evaluates to FALSE. This argument can use any comparison calculation operator. Value_if_true is the value that is returned if logical_test is TRUE. For example, if this argument is the text string "Within budget" and the logical_test argument evaluates to TRUE, then the IF function displays the text "Within budget". If logical_test is TRUE and value_if_true is blank, this argument returns 0 (zero). To display the word TRUE, use the logical value TRUE for this argument. Value_if_true can be another formula. Value_if_false is the value that is returned if logical_test is FALSE. For example, if this argument is the text string "Over budget" and the logical_test argument evaluates to FALSE, then the IF function displays the text "Over budget". If logical_test is FALSE and value_if_false is omitted, (that is, after value_if_true, there is no comma), then the logical value FALSE is returned. If logical_test is FALSE and value_if_false is blank (that is, after value_if_true, there is a comma followed by the closing parenthesis), then the value 0 (zero) is returned. Value_if_false can be another formula. Remarks

Up to seven IF functions can be nested as value_if_true and value_if_false arguments to construct more elaborate tests. (See Example 3 for a sample of nested IF functions.) If you want to test more than seven conditions, consider using the LOOKUP, VLOOKUP, or HLOOKUP function. (See Example 4 for a sample of the LOOKUP function.) When the value_if_true and value_if_false arguments are evaluated, IF returns the value returned by those statements. If any of the arguments to IF are arrays, every element of the array is evaluated when the IF statement is carried out. Microsoft Excel provides additional functions that can be used to analyze your data based on a condition. For example, to count the number of occurrences of a string of text or a number within a range of cells, use the COUNTIF worksheet function. To calculate a sum based on a string of text or a number within a range, use the SUMIF worksheet function. Learn about calculating a value based on a condition.

Example 1 The example may be easier to understand if you copy it to a blank worksheet. How to copy an example

A 1 2 Data 50 Formula =IF(A2<=100,"Within budget","Over budget") =IF(A2=100,SUM(B5:B15),"") Description (Result) If the number above is less than or equal to 100, then the formula displays "Within budget". Otherwise, the function displays "Over budget" (Within budget) If the number above is 100, then the range B5:B15 is calculated. Otherwise, empty text ("") is returned ()

Example 2 The example may be easier to understand if you copy it to a blank worksheet. How to copy an example

A 1 2 3 4 500 500 Formula =IF(A2>B2,"Over Budget","OK") =IF(A3>B3,"Over Budget","OK")


Example 3

B Predicted Expenses 900 900 925 Description (Result) Checks whether the first row is over budget (Over Budget) Checks whether the second row is over budget (OK)

Actual Expenses 1500

The example may be easier to understand if you copy it to a blank worksheet. How to copy an example

A 1 2 3 4 90 78 Formula =IF(A2>89,"A",IF(A2>79,"B", IF(A2>69,"C",IF(A2>59,"D","F")))) =IF(A3>89,"A",IF(A3>79,"B", IF(A3>69,"C",IF(A3>59,"D","F")))) =IF(A4>89,"A",IF(A4>79,"B", IF(A4>69,"C",IF(A4>59,"D","F")))) Description (Result) Assigns a letter grade to the first score (F) Assigns a letter grade to the second score (A) Assigns a letter grade to the third score (C) Score 45

In the preceding example, the second IF statement is also the value_if_false argument to the first IF statement. Similarly, the third IF statement is the value_if_false argument to the second IF statement. For example, if the first logical_test (Average>89) is TRUE, "A" is returned. If the first logical_test is FALSE, the second IF statement is evaluated, and so on. The letter grades are assigned to numbers using the following key.

IF SCORE IS Greater than 89 From 80 to 89 From 70 to 79 From 60 to 69 Less than 60


Example 4

THEN RETURN A B C D F

In this example, the LOOKUP function is used instead of the IF function because there are thirteen conditions to test. The example may be easier to understand if you copy it to a blank worksheet. How to copy an example

A 1 2 3 4 90 78 Formula =LOOKUP(A2,{0,60,63,67,70,73,77,80,83,87,90,93,97},{"F","D","D","D+","C-","C","C+","B-","B","B+","A-","A","A+"}) =LOOKUP(A3,{0,60,63,67,70,73,77,80,83,87,90,93,97},{"F","D","D","D+","C-","C","C+","B-","B","B+","A-","A","A+"}) =LOOKUP(A4,{0,60,63,67,70,73,77,80,83,87,90,93,97},{"F","D","D","D+","C-","C","C+","B-","B","B+","A-","A","A+"}) Description (Result) Assigns a letter grade to the first score (F) Assigns a letter grade to the second score (A-) Assigns a letter grade to the third score (C+) Score 45

MS EXCEL: IF FUNCTION (WS)


Learn how to use the Excel IF function with syntax and examples.

DESCRIPTION
The Microsoft Excel IF function returns one value if a specified condition evaluates to TRUE, or another value if it evaluates to FALSE.

SYNTAX
The syntax for the Microsoft Excel IF function is: IF( condition, [value_if_true], [value_if_false] ) PARAMETERS OR ARGUMENTS condition is the value that you want to test. value_if_true is optional. It is the value that is returned if condition evaluates to TRUE. value_if_false is optional. It is the value that is return if condition evaluates to FALSE.

APPLIES TO
The IF function can be used in the following versions of Microsoft Excel: Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

TYPE OF EXCEL FUNCTION


The IF function can be used in Microsoft Excel as the following type of function: Worksheet function (WS)

EXAMPLE (AS WORKSHEET FUNCTION)


Let's look at some Excel IF function examples and explore how you would use the IF function as a worksheet function in Microsoft Excel:

Based on the spreadsheet above, the following Excel IF examples would return:

=IF(A1>10, "Larger", "Smaller") =IF(A1=20, "Equal", "Not Equal") =IF(A2="Tech on the Net", 12, 0)

would return "Larger" would return "Not Equal" would return 12

Learn how to nest multiple IF Functions. (up to 7) Learn how to nest multiple IF Functions. (more than 7)

FREQUENTLY ASKED QUESTIONS Question: In Microsoft Excel, I'd like to use the IF function to create the following logic:
if C11>=620, and C10="F"or"S", and C4<=$1,000,000, and C4<=$500,000, and C7<=85%, and C8<=90%, and C12<=50, and C14<=2, and C15="OO", and C16="N", and C19<=48, and C21="Y", then reference cell A148 on Sheet2. Otherwise, return an empty string.

Answer: The following formula would accomplish what you are trying to do:
=IF(AND(C11>=620, OR(C10="F",C10="S"), C4<=1000000, C4<=500000, C7<=0.85, C8<=0.9, C12<=50, C14<=2, C15="OO", C16="N", C19<=48, C21="Y"), Sheet2!A148, "")

Question: In Microsoft Excel, I'm trying to use the IF function to return 0 if cell A1 is either < 150,000
or > 250,000. Otherwise, it should return A1.

Answer: You can use the OR function to perform an OR condition in the IF function as follows:
=IF(OR(A1<150000,A1>250000),0,A1) In this example, the formula will return 0 if cell A1 was either less than 150,000 or greater than 250,000. Otherwise, it will return the value in cell A1.

Question: In Microsoft Excel, I'm trying to use the IF function to return 25 if cell A1 > 100 and cell B1
< 200. Otherwise, it should return 0.

Answer: You can use the AND function to perform an AND condition in the IF function as follows:
=IF(AND(A1>100,B1<200),25,0) In this example, the formula will return 25 if cell A1 is greater than 100 and cell B1 is less than 200. Otherwise, it will return 0.

Question: In Microsoft Excel, I need to write a formula that works this way:
IF (cell A1) is less than 20, then times it by 1, IF it is greater than or equal to 20 but less than 50, then times it by 2 IF its is greater than or equal to 50 and less than 100, then times it by 3 And if it is great or equal to than 100, then times it by 4

Answer: You can write a nested IF statement to handle this. For example:
=IF(A1<20, A1*1, IF(A1<50, A1*2, IF(A1<100, A1*3, A1*4)))

Question: In Microsoft Excel, I need a formula in cell C5 that does the following:
IF A1+B1 <= 4, return $20 IF A1+B1 > 4 but <= 9, return $35 IF A1+B1 > 9 but <= 14, return $50 IF A1+B1 > 15, return $75

Answer: In cell C5, you can write a nested IF statement that uses the AND function as follows:
=IF((A1+B1)<=4,20,IF(AND((A1+B1)>4,(A1+B1)<=9),35,IF(AND((A1+B1)>9,(A1+B1)<=14),50 ,75)))

Question: In Microsoft Excel, I need a formula that does the following:


IF the value in cell A1 is BLANK, then return "BLANK" IF the value in cell A1 is TEXT, then return "TEXT" IF the value in cell A1 is NUMERIC, then return "NUM"

Answer: You can write a nested IF statement that uses the ISBLANK function, the ISTEXT
function, and the ISNUMBER function as follows: =IF(ISBLANK(A1)=TRUE,"BLANK",IF(ISTEXT(A1)=TRUE,"TEXT",IF(ISNUMBER(A1)=TRUE,"NUM", "")))

Question: In Microsoft Excel, I want to write a formula for the following logic:
IF R1<0.3 AND R2<0.3 AND R3<0.42 THEN "OK" OTHERWISE "NOT OK"

Answer: You can write an IF statement that uses the AND function as follows:
=IF(AND(R1<0.3,R2<0.3,R3<0.42),"OK","NOT OK")

Question: In Microsoft Excel, I need a formula for the following:


IF cell A1= PRADIP then value will be 100 IF cell A1= PRAVIN then value will be 200 IF cell A1= PARTHA then value will be 300 IF cell A1= PAVAN then value will be 400

Answer: You can write an IF statement as follows:


=IF(A1="PRADIP",100,IF(A1="PRAVIN",200,IF(A1="PARTHA",300,IF(A1="PAVAN",400,""))))

Question: In Microsoft Excel, I want to calculate following using an "if" formula:


if A1<100,000 then A1*.1% but minimum 25 and if A1>1,000,000 then A1*.01% but maximum 5000

Answer: You can write a nested IF statement that uses the MAX function and the MIN function as
follows: =IF(A1<100000,MAX(25,A1*0.1%),IF(A1>1000000,MIN(5000,A1*0.01%),""))

Question: In Microsoft Excel, I am trying to create an IF statement that will repopulate the data from
a particular cell if the data from the formula in the current cell equals 0. Below is my attempt at creating an IF statement that would populate the data; however, I was unsuccessful. =IF(IF(ISERROR(M24+((L24-S24)/AA24)),"0",M24+((L24-S24)/AA24)))=0,L24) The initial part of the formula calculates the EAC (Estimate At completion = AC+(BAC-EV)/CPI); however if the current EV (Earned Value) is zero, the EAC will equal zero. IF the outcome is zero, I would like the BAC (Budget At Completion), currently recorded in another cell (L24), to be repopulated in the current cell as the EAC.

Answer: You can write an IF statement that uses the OR function and the ISERROR function as
follows: =IF(OR(S24=0,ISERROR(M24+((L24-S24)/AA24))),L24,M24+((L24-S24)/AA24))

Question: I have been looking at your Excel IF, AND and OR sections and found this very helpful,
however I cannot find the right way to write a formula to express if C2 is either 1,2,3,4,5,6,7,8,9 and F2 is F and F3 is either D,F,B,L,R,C then give a value of 1 if not then 0. I have tried many formulas but just can't get it right, can you help please?

Answer: You can write an IF statement that uses the AND function and the OR function as
follows: =IF(AND(C2>=1,C2<=9, F2="F",OR(F3="D",F3="F",F3="B",F3="L",F3="R",F3="C")),1,0)

Question:In Excel, I have a roadspeed of a car in m/s in cell A1 and a drop down menu of different
units in C1 (which unclude mph and kmh). I have used the following IF function in B1 to convert the number to the unit selected from the dropdown box: =IF(C1="mph","=A1*2.23693629",IF(C1="kmh","A1*3.6")) However say if kmh was selected B1 literally just shows A1*3.6 and does not actually calculate it. Is there away to get it to calculate it instead of just showing the text message?

Answer: You are very close with your formula. Because you are performing mathematical operations
(such as A1*2.23693629 and A1*3.6), you do not need to surround the mathematical formulas in quotes. Quotes are necessary when you are evaluating strings, not performing math. Try the following: =IF(C1="mph",A1*2.23693629,IF(C1="kmh",A1*3.6))

Question:For an IF statement in Excel, I want to combine text and a value. 9

For example, I want to put an equation for work hours and pay. IF I am paid more than I should be, I want it to read how many hours I owe my boss. But if I work more than I am paid for, I want it to read what my boss owes me (hours*Pay per Hour). I tried the following: =IF(A2<0,"I owe boss" abs(A2) "Hours","Boss owes me" abs(A2)*15 "dollars") Is it possible or do I have to do it in 2 separate cells? (one for text and one for the value)

Answer: There are two ways that you can concatenate text and values. The first is by using the &
character to concatenate: =IF(A2<0,"I owe boss " & ABS(A2) & " Hours","Boss owes me " & ABS(A2)*15 & dollars") Or the second method is to use the CONCATENATE function: =IF(A2<0,CONCATENATE("I owe boss ", ABS(A2)," Hours"), CONCATENATE("Boss owes me ", ABS(A2)*15, " dollars")) "

Question:I have Excel 2000. IF cell A2 is greater than or equal to 0 then add to C1. IF cell B2 is
greater than or equal to 0 then subtract from C1. IF both A2 and B2 are blank then equals C1. Can you help me with the IF function on this one?

Answer: You can write a nested IF statement that uses the AND function and the ISBLANK
function as follows: =IF(AND(ISBLANK(A2)=FALSE,A2>=0),C1+A2, IF(AND(ISBLANK(B2)=FALSE,B2>=0),C1-B2, IF(AND(ISBLANK(A2)=TRUE, ISBLANK(B2)=TRUE),C1,"")))

Question:How would I write this equation in Excel? IF D12<=0 then D12*L12, IF D12 is > 0 but
<=600 then D12*F12, IF D12 is >600 then ((600*F12)+((D12-600)*E12))

Answer: You can write a nested IF statement as follows:


=IF(D12<=0,D12*L12,IF(D12>600,((600*F12)+((D12-600)*E12)),D12*F12))

Question:In Excel, I have this formula currently:


=IF(OR(A1>=40, B1>=40, C1>=40), "20", (A1+B1+C1)-20) If one of my salesman does sale for $40-$49, then his commission is $20; however if his/her sale is less (for example $35) then the commission is that amount minus $20 ($35-$20=$15). I have 3

10

columns that are needed based on the type of sale. Only one column per row will be needed. The problem is that, when left blank, the total in the formula cell is -20. I need help setting up this formula so that when the 3 columns are left blank, the cell with the formula is left blank as well.

Answer: Using the AND function and the ISBLANK function, you can write your IF statement as
follows: =IF(AND(ISBLANK(A1),ISBLANK(B1),ISBLANK(C1)),"",IF(OR(A1>40, B1>40, C1>40), "20", (A1+B1+C1)-20)) In this formula, we are using the ISBLANK function to check if all 3 cells A1, B1, and C1 are blank, and if they are return a blank value (""). Then the rest is the formula that you originally wrote.

Question:In Excel, I need to create a simple booking and and out system, that shows a date out and
a date back "A1" = allows person to input date booked out "A2" =allows person to input date booked back in "A3"= shows status of product, eg, booked out, overdue return etc. I can automate A3 with the following IF function: =IF(ISBLANK(A2),"booked out","returned") But what I cant get to work is if the product is out for 10 days or more, I would like the cell to say "send email" Can you assist?

Answer: Using the TODAY function and adding an additional IF function, you can write your
formula as follows: =IF(ISBLANK(A2),IF(TODAY()-A1>10,"send email","booked out"),"returned")

Question:Using Microsoft Excel, I need a formula in cell U2 that does the following:
IF the date in E2<=12/31/2010, return T2*0.75 IF the date in E2>12/31/2010 but <=12/31/2011, return T2*0.5 IF the date in E2>12/31/2011, return T2*0 I tried using the following formula, but it gives me #VALUE! =IF(E2<=DATE(2010,12,31),T2*0.75), IF(AND(E2>DATE(2010,12,31),E2<=DATE(2011,12,31)),T2*0.5,T2*0)

11

Can someone please help? Thanks.

Answer: You were very close...you just need to adjust your brackets as follows:
=IF(E2<=DATE(2010,12,31),T2*0.75, IF(AND(E2>DATE(2010,12,31),E2<=DATE(2011,12,31)),T2*0.5,T2*0))

Question:In Excel, I would like to add 60 days if grade is 'A', 45 days if grade is 'B' and 30 days if
grade is 'C'. It would roughly look something like this, but I'm struggling with commas, brackets, etc. (IF C5=A)=DATE(YEAR(B5)+0,MONTH(B5)+0,DAY(B5)+60), (IF C5=B)=DATE(YEAR(B5)+0,MONTH(B5)+0,DAY(B5)+45), (IF C5=C)=DATE(YEAR(B5)+0,MONTH(B5)+0,DAY(B5)+30)

Answer:You should be able to achieve your date calculations with the following formula:
=IF(C5="A",B5+60,IF(C5="B",B5+45,IF(C5="C",B5+30)))

Question:In Excel, I am trying to write a function and can't seem to figure it out. Could you help?
IF D3 is < 31, then 1.51 IF D3 is between 31-90, then 3.40 IF D3 is between 91-120, then 4.60 IF D3 is > 121, then 5.44

Answer:You can write your formula as follows:


=IF(D3>121,5.44,IF(D3>=91,4.6,IF(D3>=31,3.4,1.51)))

Question:I would like ask a question regarding the IF statement. How would I write in Excel this
problem? I have to check if cell A1 is empty and if not, check if the value is less than equal to 5. Then multiply the amount entered in cell A1 by .60. The answer will be displayed on Cell A2.

Answer:You can write your formula in cell A2 using the IF function and ISBLANK function as
follows: =IF(AND(ISBLANK(A1)=FALSE,A1<=5),A1*0.6,"")

12

Question:In Excel, I'm trying to nest an OR command and I can't find the proper way to write it. I
want the spreadsheet to do the following: If D6 equals "HOUSE" and C6 equals either "MOUSE" or "CAT", I want to return the value in cell B6. Otherwise, the formula should return the value "BLANK". I tried the following: =IF((D6="HOUSE")*(C6="MOUSE")*OR(C6="CAT"));B6;"BLANK") If I only ask for HOUSE and MOUSE or HOUSE and CAT, it works, but as soon as I ask for MOUSE OR CAT, it doesn't work.

Answer:You can write your formula using the AND function and OR function as follows:
=IF(AND(D6="HOUSE",OR(C6="MOUSE",C6="CAT")),B6,"BLANK") This will return the value in B6 if D6 equals "HOUSE" and C6 equals either "MOUSE" or "CAT". If those conditions are not met, the formula will return the text value of "BLANK".

Question:In Microsoft Excel, I'm trying to write the following formula:


If cell A1 equals "jaipur", "udaipur" or "jodhpur", then cell A2 should display "rajasthan" If cell A1 equals "bangalore", "mysore" or "belgum", then cell A2 should display "karnataka" Please help.

Answer:You can write your formula using the OR function as follows:


=IF(OR(A1="jaipur",A1="udaipur",A1="jodhpur"),"rajasthan", IF(OR(A1="bangalore",A1="mysore",A1="belgum"),"karnataka")) This will return "rajasthan" if A1 equals either "jaipur", "udaipur" or "jodhpur" and it will return "karnataka" if A1 equals either "bangalore", "mysore" or "belgum".

Question:In Microsoft Excel I'm trying to achieve the following with IF function:
If a value in any cell in column F is "food" then add the value of its corresponding cell in column G (eg a corresponding cell for F3 is G3). The IF function is performed in another cell altogether. I can do it for a single pair of cells but I don't know how to do it for an entire column. Could you help? At the moment, I've got this: =IF(F3="food"; G3; 0)

Answer:This formula can be created using the SUMIF formula instead of using the IF function:

13

=SUMIF(F1:F10,"=food",G1:G10) This will evaluate the first 10 rows of data in your spreadsheet. You may need to adjust the ranges accordingly. I notice that you separate your parameters with semi-colons, so you might need to replace the commas in the formula above with semi-colons.

Question:Im looking for an Exel formula that says:


If F3 is "H" and E3 is "H", return 1

If F3 is "A" and E3 is "A", return 2

If F3 is "d" and E3 is "d", return 3 Appreciate if you can help.

Answer:This Excel formula can be created using the AND formula in combination with the IF
function: =IF(AND(F3="H",E3="H"),1,IF(AND(F3="A",E3="A"),2,IF(AND(F3="d",E3="d"),3,""))) We've defaulted the formula to return a blank if none of the conditions above are met.

14

MS EXCEL: NESTED IF FUNCTIONS (WS)


Learn how to nest the Excel IF function with syntax and examples.

DESCRIPTION
It is possible to nest multiple IF functions within one Excel formula. You can nest up to 7 IF functions to create a complex IF THEN ELSE statement.

SYNTAX
The syntax for the nesting the IF function is: IF( condition1, value_if_true1, IF( condition2, value_if_true2, value_if_false2 )) This would be equivalent to the following IF THEN ELSE statement: IF condition1 THEN value_if_true1 ELSEIF condition2 THEN value_if_true2 ELSE value_if_false2 END IF PARAMETERS OR ARGUMENTS

condition is the value that you want to test. value_if_true is the value that is returned if condition evaluates to TRUE. value_if_false is the value that is return if condition evaluates to FALSE.
NOTE
This Nested IF function syntax demonstrates how to nest two IF functions. You can nest up to 7 IF functions.

APPLIES TO
The Nested IF function can be used in the following versions of Microsoft Excel: Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

15

TYPE OF EXCEL FUNCTION


The Nested IF function can be used in Microsoft Excel as the following type of function: Worksheet function (WS)

EXAMPLE (AS WORKSHEET FUNCTION)


Let's look at an example to see how you would use a Nested IF examples and explore how you would use the Nested IF function as a worksheet function in Microsoft Excel:

Based on the spreadsheet above, the following Excel Nested IF examples would return:

=IF(A1="10x12",120,IF(A1="8x8",64,IF(A1="6x6",36))) =IF(A2="10x12",120,IF(A2="8x8",64,IF(A2="6x6",36))) =IF(A3="10x12",120,IF(A3="8x8",64,IF(A3="6x6",36)))

would return 120 would return 64 would return 36

FREQUENTLY ASKED QUESTIONS Question: In Microsoft Excel, I need to write a formula that works this way:
If (cell A1) is less than 20, then multiply by 1, If it is greater than or equal to 20 but less than 50, then multiply by 2 If its is greater than or equal to 50 and less than 100, then multiply by 3 And if it is great or equal to than 100, then multiply by 4

16

Answer: You can write a nested IF statement to handle this. For example:
=IF(A1<20, A1*1, IF(A1<50, A1*2, IF(A1<100, A1*3, A1*4)))

Question:In Excel, I need a formula in cell C5 that does the following:


IF A1+B1 <= 4, return $20 IF A1+B1 > 4 but <= 9, return $35 IF A1+B1 > 9 but <= 14, return $50 IF A1+B1 > 15, return $75

Answer:In cell C5, you can write a nested IF statement that uses the AND function as follows:
=IF((A1+B1)<=4,20,IF(AND((A1+B1)>4,(A1+B1)<=9),35,IF(AND((A1+B1)>9,(A1+B1)<=14),50 ,75)))

Question: In Microsoft Excel, I need a formula for the following:


IF cell A1= PRADIP then value will be 100 IF cell A1= PRAVIN then value will be 200 IF cell A1= PARTHA then value will be 300 IF cell A1= PAVAN then value will be 400

Answer: You can write an IF statement as follows:


=IF(A1="PRADIP",100,IF(A1="PRAVIN",200,IF(A1="PARTHA",300,IF(A1="PAVAN",400,""))))

Question: In Microsoft Excel, I want to calculate following using an "if" formula:


if A1<100,000 then A1*.1% but minimum 25 and if A1>1,000,000 then A1*.01% but maximum 5000

Answer: You can write a nested IF statement that uses the MAX function and the MIN function as
follows: =IF(A1<100000,MAX(25,A1*0.1%),IF(A1>1000000,MIN(5000,A1*0.01%),""))

Question:I have Excel 2000. If cell A2 is greater than or equal to 0 then add to C1. If cell B2 is
greater than or equal to 0 then subtract from C1. If both A2 and B2 are blank then equals C1. Can you help me with the IF function on this one?

17

Answer: You can write a nested IF statement that uses the AND function and the ISBLANK
function as follows: =IF(AND(ISBLANK(A2)=FALSE,A2>=0),C1+A2, IF(AND(ISBLANK(B2)=FALSE,B2>=0),C1-B2, IF(AND(ISBLANK(A2)=TRUE, ISBLANK(B2)=TRUE),C1,"")))

Question:How would I write this equation in Excel? If D12<=0 then D12*L12, If D12 is > 0 but <=600
then D12*F12, If D12 is >600 then ((600*F12)+((D12-600)*E12))

Answer: You can write a nested IF statement as follows:


=IF(D12<=0,D12*L12,IF(D12>600,((600*F12)+((D12-600)*E12)),D12*F12))

Question:I have read your piece on nested IFs in Excel, but I still cannot work out what is wrong
with my formula please could you help? Here is what I have: =IF(63<=A2<80,1,IF(80<=A2<95,2,IF(A2=>95,3,0)))

Answer: The simplest way to write your nested IF statement based on the logic you describe above
is: =IF(A2>=95,3,IF(A2>=80,2,IF(A2>=63,1,0))) This formula will do the following: If A2 >= 95, the formula will return 3 (first IF function) If A2 < 95 and A2 >= 80, the formula will return 2 (second IF function) If A2 < 80 and A2 >= 63, the formula will return 1 (third IF function) If A2 < 63, the formula will return 0

18

Вам также может понравиться