For powerful data analysis, you may often need to build an Excel IF statement with multiple conditions or use IF together with other functions. This tutorial will show you the most effective ways to do this. Continue reading
by Svetlana Cheusheva, updated on
For powerful data analysis, you may often need to build an Excel IF statement with multiple conditions or use IF together with other functions. This tutorial will show you the most effective ways to do this. Continue reading
Comments page 116. Total comments: 4573
Hi,
I need to create an IF/AND formula based on the information below.
FOR EXAMPLE:
If Cell 'A2' = Very Low & Cell 'B2' = Very Low......then I want Cell 'C2'= 2 (and vice versa)
If Cell 'A3' = "Very High" & Cell 'B3'= Very High.....then Cell 'C3'= 4
(and vice versa)
If Cell 'A4' = Very High & Cell 'B4'= Very Low......then Cell 'C4'= 3
(and vice versa)
So far my formula is =IF((AND(A2="Very Low",B2="Very Low")), "2").....
Please help on how to complete the formula to include the other possible variations
I am having difficulties with the below formula.
=IF(A10&C10&D10="Corrugated & Trimdeck .42 Colorbond Re-roofing"&"28-34 Degree Pitch"&"<=99",E34,)
In this specific example:
A10 = Corrugated & Trimdeck .42 Colorbond Re-roofing
C10 = 28-34 Degree Pitch
D10 = the figure entered is anywhere between 0 and 99
E34 = a cost of $10 should be returned as entered in E34
It does not return the number as detailed in E34, only a 0.
Can I have 3 rules in the one formula?
Hi there, I was wondering if someone could please help with a formula I am trying to put together.
I have sent an e-mail with sample data on support@ablebits.com
I have some text in Column A (around 8,000 rows) and I would like to shortlist that into 10 categories. I am not sure if its possible to put a "If" formula if there was one because of complications around the formatting in Column A.
Can you please help or suggest a way to do this more efficiently as this would be my monthly process.
Thanks in anticipation.
Hi trying to build the following formula:
If Cell G3 = 1 and Cell I3 = 36 Return "-2"
If Cell G3 = 1 and Cell I3 = 37 Return "-3"
If Cell G3 = 1 and Cell I3 = 38 Return "-4"
The formula I have written is:
=IF(AND(G3="1"(I3>37,"-4",IF(I3=37,"-3",IF(I3=36,"-2","0")))))
This doesn't appear to work. Could you help?
Hi Russ,
Try the following syntax:
=IF(AND(G3=1,I3>37),-4, IF(AND(G3=1,I3=37),-3, IF(AND(G3=1,I3=36),-2,0)))
Please note that in Excel formulas, you should not enclose numbers in double quotes unless you want them to be treated as text values.
Hi, I'm trying to build a formula with 3 logic tests as follows:
If cell E4 is blank then = blank
If cell G4 plus 29 days is < today’s date then = Compliant
If cell G4 plus 28 days is < today’s date then if true = Review required if not Overdue
Below is what I have in Excel
=IF(ISBLANK(E4),"", IF((G17+29)<TODAY(),"Compliant",IF((G4+28)<TODAY(),"Overdue","Review required"))
Everything appears to work except for IF((G17+29)<TODAY(),"Compliant"
What is wrong with my formula?
Hi Claire,
That's probably because in your formula it's IF((G17+29)<TODAY() while the condition reads "cell G4 plus 29 days". Please check this.
Hi,
I need your help with a simple formula but it`s giving me a hard time. I need the result to be
if(b=0,"100", if(f=0,0), if not f/b
I do not seem to make the formula work. Would you please help?
Guddu,
A1 being previous sales, A2 being current sales.
=IF(A1>A2,A1,A2)
i want to create a marks card, as like class 12th marks card in india , so plz which formula i use in it give me all..
If I compare two year sales and amount of previous one is greater than present month then the result will show the greater one.
Please help
awesome way too helpful .. thanks alot
Ok. Here is my issue. I am trying to reference another sheet(Sheet1) and run 2 logical tests and return the value of the corresponding B column of any that match the tests. This is what I used
=IFERROR(INDEX(Sheet1!$B$2:$B$5000,SMALL(IF(AND(""=Sheet1!$AX$2:$AX$5000,"YES"=Sheet1!$CV$2:$CV$5000),ROW(Sheet1!$AX$2:$AX$5000:Sheet1!$CV$2:$CV$5000)-ROW($A$2)+1),ROW(1:1))),"")
When the logical if statements are done separately they seem to work but together they do not. this is a modified version of this formula
=IFERROR(INDEX(Sheet1!$B$2:$B$5000,SMALL(IF("NEW"=Sheet1!$O$2:$O$5000,ROW(Sheet1!$O$2:$O$5000)-ROW($A$2)+1),ROW(1:1))),"")
This formula is similar and works but I have not been able to get 2 logical tests to work together properly.
Anyone willing to give this one a shot that would be awesome.
I am trying to create a formula to reference a certain cell's text. What I want it to do is input a value based on what text is in a certain cell. For example, I want it to refer to cell E6 and if it is biannual, I want it to input 2. If it's annual, I want it to input 1, if it's monthly, I want it to input 12, and if it's quarterly, I want it to input 4. Can it do something like that?
Yes. That should be very simple to create. Multiple (If) statements will get that done.
Hi,
IF A1 is greater than A2 then value=B1, and if A1 is greater than A3 then value=b2 or B1.
I am calculation plan value for my forecasted date vs my data date. Kindly advise.
Thanks.
I need an IF formula for:
IF P20 equals 83-100, Highly Effective
IF P20 equals 66 – 82, Effective
IF P20 equals 53 – 65, Needs Improvement
IF P20 equals 0 - 52, Unsatisfactory
Hi Jackie,
You need a nested IF formula like this:
=IF(P20>=83, "Highly Effective", IF(P20>=66, "Effective", IF(P20>=53, "Needs Improvement", "Unsatisfactory")))
Looking for assistance with the following:
If the date in E2 is prior to today AND L2 is less then 0 then return CHECK if false then return OK
Hi Stacey,
Here you are:
=IF(AND(E2<TODAY(), L2<0), "CHECK", "OK")
IF A1= "any value" then A1= sum of B1,B2 or "zero"
Please advise. Thanks.
Hi Riyaz,
Here you go:
=IF(A1<>"", B1+B2, 0)
Thank you so much Svetlana Cheusheva
A1 = RECEIVED / CANCELLED / DECLINED (Dropdown)
If A1="CANCELLED" then A2, A3, A4... will show CANCELLED
If A1="DECLINED" then A2, A3, A4... will show DECLINED
but
If A1="RECEIVED" then A2, A3, A4... must be blank
Please advise. Thank you
HI BRENDA,
TRY THIS
=IF(A1="CANCELLED","CANCELLED","")&IF(A1="DECLINED","DECLINED","")&IF(A1="RECEIVED","","")
Hi Svetlana,
I am having a bit trouble with the IF function with ISNUMBER and FIND/SEARCH to match and substitute strings. However, I am not getting the desired outcome. Let say, Cell 1 has string "Kara", Cell 2 has "Karam".This is my formula =IF((ISNUMBER(FIND(A1,A2))),SUBSTITUTE(A1,A1,A2),A2). Now, it is substituting Cell 1 string with Cell 2. However, I want it to substitute on the basis of full name. For instance, if Cell 2 had "Kara & Jones", then it should substitute, not only if the same characters are found. Any comments or directions would be highly appreciated!thx
Guys,
If you have any suggestions regarding my problem, I would be grateful!
I want to make this formula works:
if cell B2=0 then Cell C2=0 if cell B is not equal 0 then use this formula (C2*25)+25) to calculate the result of cell C2
Here i am attaching two sheets, One interest rate. The other interest charged. I want to have a clear sheet when ever there is change in interest based on the balance rate to be charged monthly. I want to know what the formula to be used.
sheet 1
FROM TO INT RATE
31-03-2011 24-04-2011 8.25
25-04-2011 11-05-2011 8.50
12-05-2011 10-07-2011 9.25
11-07-2011 12-08-2011 9.50
13-08-2011 19-09-2012 10.00
20-09-2012 03-02-2013 9.75
sheet2
DATE DR CR BALANCE NO.OF DAYS
31-03-2011 45455604 45455604 30 24 5
30-04-2011 394156 45849760 1
01-05-2011 394156 45455604 11
12-05-2011 3000100 42455504 19
31-05-2011 425189 42880693 1
01-06-2011 425189 42455504 29
30-06-2011 401292 42856796 1
01-07-2011 401292 42455504 7
08-07-2011 921233 41534271 23
31-07-2011 413676 41947947 1
01-08-2011 413676 41534271 30
31-08-2011 425299 41959570 1
01-09-2011 425299 41534271 29
30-09-2011 418187 41952458 0
01-10-2011 418187 41534271 30
31-10-2011 432127 41966398 1
01-11-2011 432127 41534271 2
03-11-2011 432127 41966398 14
17-11-2011 432127 41534271 13
30-11-2011 420218 41954489 1
01-12-2011 420218 41534271 30
31-12-2011 432127 41966398 1
01-01-2012 41966398 23
24-01-2012 66112 42032510 7
31-01-2012 370511 42403021 29
29-02-2012 412703 42815724 2
02-03-2012 432127 42383597 29
31-03-2012 441109 42824706 30
actually interest charged is 394156 but according to my cal Outstanding 45455604 * 24 days *8.25%/365 + 45455604*5 days *8.50/365 should be my interest
What is the formula used by combing sheet 1 and sheet2 to calculate the interest
Using Google Sheets.
I have a formula that is using validated data to display a value in a field:
=IF(H3="0X0", "$0.00", IF(H3="12 x 2", "$120.00", IF(H3="15 x 3", "$220.00", IF(H3="19 x 4", "$380.00", IF(H3="10 x 7", "$350.00")))))
This works perfectly, however, I cannot get total of the values returned. I am using the following formula: =Sum(I3,G3,E3,C3)
Don't worry I figured it out: remove the '$' from the formula and use =Sum(I3+G3+E3+C3)
Using Google Sheets.
I have a formula that is using validated data to display a value in a field:
=IF(H3="0X0", "$0.00", IF(H3="12 x 2", "$120.00", IF(H3="15 x 3", "$220.00", IF(H3="19 x 4", "$380.00", IF(H3="10 x 7", "$350.00")))))
This works perfectly, however, I cannot get total of the values returned. I am using the following formula: =Sum(I3,G3,E3,C3)
I have three worksheets that contain about 50 customer names. How can I assign the salesman name (forth worksheet) to each customer? I would like to do something like: if sheet1 list customer xxx, yyy and zz,their salesmen is A.
Thanks for the advise
HOW TO FIND EARLIEAST DATE CELL CONTAINS TEXT AND D DATE . 28 29-Nov-15 02-Dec-15 09-Dec-15 55 06-Dec-15 09-Dec-15 16-Dec-15
NO THANKS AND I WILL FIND THE ANSWER
HOW TO DO THIS QUESTION
CALCULATE THE CHARGE VALUE BY USING IF FUNCTION
Name units charge
raja 250 condition
kumar 150 0 to 200 - 1UNIT - Rs 6
sasi 800 200 to 500 - 1UNIT - Rs 9
mala 469 >500 - 1UNIT - Rs 12
raciga 640
uthayan 68
susila 342
CALCULATE THE CHARGE VALUE BY USING IF FUNCTION
Name units CHARGE
raja 250
kumar 150
sasi 800
mala 469
raciga 640
uthay 68
susila 342
Thanks, found this really useful! :)
Hi Svetlana, I really love your site, it has helped me multiple times.
I'm currently trying to figure out a way to efficiently write a nested if statement that doesn't involve manually writing it, as I will have 52 nested ifs when finished. I was trying to concatenate the pieces of my formula, but I'm having no luck. Do you have any other ideas? Ultimately what I'm trying to do is have Excel look in one column for a value >0 and if it detects it, show a value from an adjacent cell....then I want to average those numbers.
I need a formula that does the following:
IF the value in cell B1 is BLANK, then return "BLANK"
IF the value in cell B1 is TEXT, then return "Available"
IF the value in cell B1&C1 is TEXT, then return "Filled"
I need help with a formula for conditional formatting.
IF cell D12 is blank and the date in cell C12 is within 14 days of today's date, then the text is formatted red.
Hi Carrie,
Does "within 14 days of today's date" mean 14 days in the past or in the future?
If the target date in C12 is less than 14 days from today.
So, target date is 11/15/15 it would be highlighted because it is due within 14 days.
Hi Carrie,
Select the cells (or rows) you want to format red beginning with row 12 and create a conditional formatting rule will the following formulas:
=AND($D12="", $C12>TODAY(), $C12-TODAY()<14)
Svetlana, it worked perfectly! Thank you for your assitance!
Hi Svetlana
I need a formula which shows the result of two different cell for example
the input from the two cell
1) 97130327 or 811045
2) negative(-) or positive(+)
result in cell
A) If first two character of the first cell is "97" & figure in second cell is positive then result will be "27" & if the second cell is negative then the result will be "37"
B) If first two character of the first cell is "81" & figure in second cell is positive then result will be "40" & if the second cell is negative then the result will be "50"
RESULT 1 CELL 2 CELL
37 97130127 (1000.00)
27 97130127 1000.00
50 811045 (1000.00)
40 811045 1000.00
Hello,
I am needing to integrate a formula into excel to calculate a tiered pricing schedule. The formula needs to assess if the cell value falls into one of 36 different ranges and than multiplies the cell value by a multiplier specific to that range. For example if the cell falls into the range of >5 and 15 and <=30 multiply by 9.33 and so on.
Schedule Example
Range Markup
1 5.01 to 15.00 9.37
2 15.01 to 30.00 9.33
3 30.01 to 55.00 9.30
............ ...
34 9505.01 to 9999.99 4.30
Example Correction: For example if the cell falls into the range of > 15 and <=30 multiply by 9.33 and so on.
Hi Svetlana,
I want to use a formula to match many specific, unique numbers to unique descriptions for two columns. Example is a 7 or 8 digit number (40307014) = specific description. I want to just be able to type in the unique number and have the description pop up automatically that matches the specific number. Do you have any formulas pre-written for this or advice on how to do this?
Thank you!
Hello Excel GURU,
Could you suggest a unique formula for below issue where the last column should automatically refill from formula. 10 till column 6 (for GOLD), 13 till column 12 (for DIAMOND), 25 till column 18 (for SILVER) and so on as I have big list for same criteria.waiting for your helpful response. Thanks in advance!
Serial No. GOLD 10
712755 $10.95
713296 $10.10
717453 $9.99
713812 $9.95
716291 $10.10
Serial No. DIAMOND 13
712755 $9.10
713296 $8.85
717453 $8.99
713812 $9.90
716291 $7.99
Serial No. SILVER 25
712755 $8.00
713296 $7.99
717453 $6.99
713812 $7.75
716291 $7.50
Hello,
I have stages called, 1-2,1-3,1-4 and so on and I need to called these all as Stage 1. Kindly help me how and which formula I can use for this.
Thanks,
Ashish
Hello. I have a cell that I input a simple IF statement into. For example, the formula was "=IF(C2<C3,"PASS","FAIL"). C2 and C3 are both elevations that were calculated with a simple formula also. An example of a formula for C2 or C3 might look like "=380.10 - (.02*10)" where 380.10 is a previous elevation and .02 is a slope in ft/ft and 10' is a width in feet. If the first formula returns a "pass" value, can excel tell me, and show me, which slope value made the statement true? The slope could be one of several different numbers such as .01,.02,.03,.04, and so on.
How do you nest formula across 3 or more columns to pull data from one column if another is blank? letters only no numbers or grades. I want to pull from Col 1, if not Col 2 then Col 3 when blank
Col 1 Col 2 Col 3 RESULT
1. aaa A aaa
2. bbb B bbb
3. - - - N/A
4. AA AA
5. C C
6. B+ B- B+
Thank You,
Bob
I HAVE THE BELOW DATA
IF DATE RANGE IS >361 show p1
if date range is 241 show p2
121 show p3
61 show p4
<=60 show p5.
Can u help me with the formula which can auto populate the data based on this 5 date criteria.
I have a date range of data based of which i want the data to populate.
the range is >361 it should show P1
241 show P2
Could you please help me to put the formula for the following conditions:
95-100 A
90-94 A-
87-89 B+
84-86 B
80-83 B-
74-79 C+
66-73 C
61-65 C-
56-60 D+
50-55 D
00-49 F
SUPER
hello!
I'm trying to create a formula wherein:
Cell value needs to check if it is Stop, Pending and Others.
Checks the Value in another cell it is pending or not then the condition in the table applies. wherein the cell value result will be the size.
Size Category Stop Pending& Others
X-Small <=1 <=1
Small <=3 <=2
Medium <=10 <=6
Large <=20 20 > 15
I'm trying to use a formula to return a value using multiple conditions as shown in this table:
FE Gross PVR
Units 1,450 1,500 1,550 1,600 1,650 1,700
220 32 33 34 37 39 40
210 31 32 33 36 38 39
200 30 31 32 35 37 38
190 26 27 29 32 33 34
180 25 26 28 31 32 33
170 24 25 27 30 31 32
Example: If Units are >189 and less than 1499 and less than 1550, then return the value of 27.
I would appreciate any assistance. Thank you!
for some reason the formulas post here show different what the one i write
=IF(A1>=37,10000,IF(A1>=28,1000),IF(A1>=19,100),IF(A1>=10,10),IF(A1>=1,1))
Hi!
You were almost there. You just have to close all IF's at the end of the formula, like this:
=IF(A1>=37,10000,IF(A1>=28,1000,IF(A1>=19,100,IF(A1>=10,10,IF(A1>=1,1)))))
i also use this
=IF(AND(A1>=1,A1=10,A1=19,A1=28,A1=37),10000,A1)
but it come back #VALUE
I tried all your exaples for an issu i have but non of them comes with the correct answer
i have a series o number for some score that need to be analyzed
12 16 21 33 45
i need to use a formula where is a number falls between a range of number to come back with another result this is my list
1-9 1
10-18 10
19-27 100
28-36 1000
37-45 10000
this is what I came up with
=IF(AND(A1>=1, A1=10, A1=19, A1=28, A1=37),10000,A1)))))
i also use this as a test
=IF(A1<=37,10000, IF(A1<=36,1000,IF(A1<=27,100, IF(A1<=18,10,IF(A1<=9,1)))))
but it only get th the first if statement
I am trying to write an IF statement formula for the following condition:
This is TEXT only, no numbers.
If Column F is blank, import the text value from Column K (same row)
If Column F is not blank, leave it as-is.
Hi,
My data reads:
Status Category
Successful Normal Minor.Production
Successful Normal Minor.Production
Successful Normal Minor.Production
Successful Standard-Minor
Successful Standard-Minor
Successful Normal Minor.Production
I want to compare both the columns for text and return a different text eg: "Successful Minor". I used this statement =IF(AND(C3 = "Successful", E3 = "Minor"), "Minor Successful", ) but this means the column B needs to specify minor. How do I do text search? Hope my question is clear. Appreciate your assistance.
Thank you kindly
Regards,
-V-
Hi .. I am trying to set a formula to calculate a hotel room rate based on the day of week. If Fri, Sat, Sun then $230 and if Mon-Thu $240. Person needs to enter arrival date 1/8/2016 .. then this reports back Fri (=c6 with the custom formatting of ddd)
Ex
Cell C6 has 1/8/2016, then C5 is set to =c6 (custom formatting of ddd). The formula I have is IF(C5="FRI","$230","$240").
Problem is C5 does not read FRI and is shows, but reads as =C6 and $240 is returned.
Any help in getting the formula to recognize day of week that is returned off a formula.
Thank you
I need help!
Conditions:
If sales are greater or equal to 10 then multiply the named cell RateA by Cost
If sales are greater or equal to 20 then multiply the named cell RateB by Cost
If sales are greater or equal to 30 then multiply the named cell RateC by Cost