If someone asks you what Excel function you use most often, what would your answer be? In most cases, it's the Excel IF function. A regular If formula is very straightforward and easy to write. But what if your data requires more elaborate logical tests with multiple conditions? Continue reading
Comments page 4. Total comments: 365
Hello,
I am trying to create a formula where I have 4 Yes/No fields but only 3 Yes's are required to obtain a final yes. I am having trouble figuring out how to write a formula where 3 of 4 yes's = final YES.
As you can tell, I am no excel expert so help is appreciated.
Thank you
L3 Yes/No
O3 Yes/No
R3 Yes/No
U3 Yes/No
These cells are the results of someone meeting a subset of criteria so there will be a yes if the criteria is met or a no if it is not. Same for all of the above cells. To fulfill the whole set of criteria, there must be 3 out of 4 Yeses. V3 will be either "Yes" the criteria has been met or "No" it has not been met.
I hope that helps.
I have been trying to fix this formula all day, I don't know at this point what I'm doing wrong.
=IF(D2=Full,A2=1, IF(D2=Special Case, A2=2,IF(D2=Parts, A2=3,IF(D2=T&M, A2=4,IF(D2=Not Installed,A2=5, IF(D2=Customer Issue, A2=6))))))
Please help!
Hi Erika,
If my understanding is correct, you want the output in cell A2. If so, you should not reference A2 in the formula, just enter the formula in the target cell:
=IF(D2="Full", 1, IF(D2="Special Case", 2,IF(D2="Parts", 3, IF(D2="T&M", 4, IF(D2="Not Installed", 5, IF(D2="Customer Issue", 6, ""))))))
Also, please pay attention that all text values should be enclosed in double quotes.
I have 16K+ line items and I am trying to create a formula to take out manual work that will take hours. My forumla is below. The message I get in the cell is#NAME?
What am I doing wrong?
=IF(B297=ZRO,"Return Order", IF(B297=ZC2,"Credit Request", IF(B297=ZD2,"Debit Request", IF(B297=ZB3, "Incentives", IF(B297=ZB4,"Incentives")))))
Hi Alice,
The problem is in the logical text of the first IF (B297=ZRO). "ZRO" is a text value, so it should be enclosed in double quotes (as well as "ZC2", "ZD2", etc. if they are text). If these are cell references, no double quotes then, but you need to fix ZRO anyway.
Can anyone help me with the argument below.
Age exceeding 10yrs but less than 12yrs - 5%
Age exceeding 12yrs but less than 15yrs - 20%
Age exceeding 15yrs - 50%
Assuming if Cell D3 is between 10 -12 = 5%, Cell D3 if greater than 12 but less than 15 = 20% and if greater 15 = 50%
I want to put the IF formula in Cell E10
If D3 12 but 15 then 50%
Thanks in advance
Hello. Thank you for contacting us.
Please try the following formula to get the result you need:
=IF(D3>=15, "50%", IF(D3>=12, "20%", IF(D3>=10, "5%", "")))
Thank soo much
I want a bill format like if quantity is 1 then discount will be 40% of amount and if quantity is 2 then discount will be 50% of the total amount and if quantity is 3 then discount will be 60% of the total amount
Hello, Jai,
Thank you for contacting us.
You may try the formula below:
=IF(D2=1, "40%", IF(D2=2, "50%", IF(D2=3, "60%", " ")))
I hope this helps. Please let me know if you have any other questions or difficulties.
Hi, thanks for this great site. I am stumped with an Excel nested if that uses SEARCH to query for text in the adjoining column. Here's an example
=IF(SEARCH("a",A1),"A",IF(SEARCH("b",A1),"B",IF(SEARCH("c",A1),"C",IF(SEARCH("d",A1),"D",IF(SEARCH("e",A1),"E","other")))))
Unfortunately, I only get "A" or "#VALUE". I tried including IFERROR but got the same results
=IFERROR(IF(SEARCH("a",A1),"A",IF(SEARCH("b",A1),"B",IF(SEARCH("c",A1),"C",IF(SEARCH("d",A1),"D",IF(SEARCH("e",A1),"E"))))),"other")
This only returns "A" or "other". Can you please explain why my nested loop is not nesting? Thanks in advance.
FYI, I first thought the formula was chopped off but then realized that you have to side-scroll to see the entire line.
Can we change case of text in excel without use change case formula (Uppercase, lower case, proper case)
You need a macro to do so. A function can only return a value in excel.
I can share the Macro file! Share your mail id.
By this you only need to select the range and Alt+F8.
I am trying to set up a formula were New=New, Used_Like_New=Like New, Used_Very_Good=Very Good, Used_Good=Good, & Used_Acceptable=Acceptable.
The formula I tried was =IF(AND(G2>=New), "New", "" & IF(AND(G2>=Used_Like_New), "Like New", "" & IF(AND(G2>=Used_Very_Good), "Very Good", "" & IF(AND(G2>=Used_Good), "Good ", "" & IF(AND(G2>=Used_Acceptable), "Acceptable", ""))))). I also tried =IF(AND(G2=New), "New", "" & IF(AND(G2=Used_Like_New), "Like New", "" & IF(AND(G2=Used_Very_Good), "Very Good", "" & IF(AND(G2=Used_Good), "Good ", "" & IF(AND(G2=Used_Acceptable), "Acceptable", ""))))).
I have had no luck. This is my first attempt at an If formula. Can you help me out here?
Hi Chris,
Here's the correct syntax:
=IF(G2="New", "New", IF(G2="Used_Like_New", "Like New", IF(G2="Used_Very_Good", "Very Good", IF(G2="Used_Good", "Good ", IF(G2="Used_Acceptable", "Acceptable", "")))))
Thank you!!!
Not sure why my last post didnt include my actual formula but since its not working its not a biggy :)
Hi Milli,
Our blog engine occasionally mangles formulas in comments, sorry for that.
As for your formula, please try this one:
=IF(E3="", "", IF(E3<=1989, 1, IF(E3<=2013, 2, "")))
If the list separator in your Regional Settings is set to semicolon, then it should be written like this:
=IF(E3=""; ""; IF(E3<=1989; 1; IF(E3<=2013; 2; "")))
Please note that the formula will return nothing (an empty string) if E3 is greater than 2013.
I want to convert grades in marks like for A its 5 marks, B its 4 marks , C its 3 marks, D its 2 marks and for E its 1 mark. please suggest formula.
If you want to substitute the grades in the same table they are arranged in, use Find and Replace.
However, if you want to transfer the converted data to another table, try entering this simple formula:
=70-code(A2)
where A2 is the cell with the grade.
Hi,
I have this problem with my syntax, after hit 'enter' button, no error pops up, but then, the excel only operate my 3 first condition, the remaining condition were disregard (I assumed). any chance anyone can correct my syntax?
=IF(Q12="Done","No Action Require",IF(Q12<-5,"-5,"=-3,"0,"Due","")))))
Thanks.
=IF(Q12="Done","No Action Require",IF(Q12<-5,"-5,"=-3,"0,"Due","")))))
I have already copy and paste my syntax, but when it posted, it does not show the full syntax?
HI...
Need help for..
If some value has decimal number then I need the next round number.
i.e:- 1.2=2 (1.2 should be shown me by rounding up 2)
4.9=5 (4.9 should be shown me by rounding up 5)
Thanks in advance....
Hi,
try using ROUNDUP function:
for example, if A1 contains '1.2':
=ROUNDUP(A1,0)
I am trying to get actual budget variance percentage but with an if statement. If actual amount is less than budget then do budget amount minus flex amount divided budget amount and if actual amount is greater than budget amount then do flex amount minus budget amount then divided budget amount. hope this makes sense.
thank you.
Hi, Erly,
Assuming thatC1,(B1-C1)/C1,""))
A1 – actual amount, B1 – flex amount, C1 – budget, and you want to see the result in E1, type the next formula into E1:
=IF(A1
Note, that it misses the condition when the actual amount is equal to budget amount, and in this case the function leaves the cell blank.
I need to write a "what if" statement for a column that has both numbers & text. For example 79953A, 81012B, 85023C
I want the numbers ending with A to read A Crew in a new column, B to read B Crew and C Crew.
Can I do a "what if" statement to figure out how many A's, B's & C's?
Any information you can give me would be greatly appreciated. Thank you.
Hi, Felicia,
you can try the following:
if your data starts in A1, then to return "A/B/C Crew" to B column use the formula below:
=IF(RIGHT(A1,1)="A", "A Crew", IF(RIGHT(A1,1)="B", "B Crew", IF(RIGHT(A1,1)="C", "C Crew", "")))
To count their amount use COUNTIF in column C:
=COUNTIF(B:B,"A Crew")
where B:B is a column with returned values and "A Crew" counts A appearances. To count "B Crew" and "C Crew" copy and change COUNTIF formula respectively.
Hi there! I'm not sure if this is the correct formula for what I need, but I need a formula that will return a number based on text conditions. For example, if cell A1 reads "Y" or "N/A" I would like the formula to return a 0 value in cell B1. If neither of those conditions are true, I would like B1 to return the numerical value of cell C1.
For context, I am using this to calculate how much use tax I owe. If I paid sales tax on an item or the transaction was not subject to sales tax, then I do not owe additional use tax on it. However, if I did not pay sales tax on the item, I now owe use tax on the full amount of the transaction.
Thanks!
Hi Christina,
You can use the following formula for B1:
=IF(OR(A1="Y", A1="N/A"), 0, C1)
hello sir. i hav a problem and unable to shortout.
can i use if condition for sellected range of coloumn ..
i.e.
IF (A1=(B1:B8), "true","False")
it is not corretct because the range is not accepted by if condition.
how can i do this
is there any other method to resolve this
Try this.
=If(A1=SUM(B1:B8),"True","False")
Looking for help. I have a list of zipcodes. I need a formula that says "TRUE" in the cell if the zipcode is one on the list. "FALSE" if not. Zipcodes for "TRUE" below.
98002
98003
98007
98023
98030
98031
98032
98047
98055
98056
98057
98101
98102
98104
98106
98107
98108
98109
98118
98121
98122
98125
98126
98133
98144
98146
98148
98168
98178
98188
98198
My normal If/Than does not seem to do the trick?
Your best bet is to create a table as your datasource of zipcodes and then use the VLookUp to compare the zip codes vs what is in your table.
=If(Vlookup(yourzipcodecellhere,Table,1,0)=yourzipcodecellhere,)
Hi
I've been trying to use nested formula to return a specific cost if an item is referred to in one column. Do you know why it might be returning my value as false (ie blank) if I am using the following formula just because the criteria isn't contained within the first bracket? For some reason if the first bracket is true it is fine but anything else it just shows as blank?
=CONCATENATE(IF(C5="Napoleon","£1000",""),IF(C5="Sussex","£2000",""),IF(C5="Townhouse","£3000 ",""),IF(C5="GO","£4000",""))
Actually managed to solve the one above but was wondering if it would be possible to do the formula
=IF(D2="PM",(IF(C2="Napoleon","£5000",""),IF(C2="Sussex","£3500",""),IF(C2="Townhouse","£2500 ",""),IF(C2="GO","N/A",""),IF(C2="DDR","COST","")),(IF(C2="Napoleon","£2500",""),IF(C2="Sussex","£2500",""),IF(C2="Townhouse","£1500 ",""),IF(C2="GO","N/A",""),IF(C2="DDR","COST","")))
Where I'm trying to say if D2= PM "Value if true as a nested if formula", "value if false as a nested if formula"
I need a formula in excel for the below.
A1 contains some value and B1 contains Text A, B, C, D
Formula should do the following:
if B1 is A then check the following A1 is greater than 5 but less than 10 it should return 10, if A1 is greater than 10 should return value in A1, if A1 is less than 5 should return 5, if B1 is B then check the following A1 is greater than 5 but less than 10 it should return 8, if A1 is greater than 10 should return value in A1, if A1 is less than 5 should return 5
How can you put the formulae in excel? Can any body explain
A...fine
B...fine
What if C or D?
If you want to do nothing when B1 is C or D, then formula yo use is:
=IF(B4="A",IF(AND(A4>5,A4<10),10,IF(A4#10,A4,IF(A4<5,5,"N/A"))),IF(B4="B",IF(AND(A4#5,A4<10),8,IF(A4#10,A4,IF(A4<5,5,"N/A")))))
Replace # with "greater" sign.
If B1 contain C or D, then the result is FALSE.
Hi Dear, I m user of excel I have a data in row A and row B .I want to find what data are same in both the row.please let me know the formula for the same
=A1=B1
That is. The result into cell C1 will be "TRUE" or "FALSE"
True if A1=B1, false if A1 not equal B1.
Or this formula:
=IF(A1=B1,"EQUAL","")
It is show "EQUAL" if A1=B1, and "" (nothing) if A1 not equal B1.
Bill says:
February 1, 2017 at 7:34 am
3 Range : Time, Value A, Value B
Triger : “>=7”
condition : between A and B, who reach 7 first in period of time 1 to 6, then win.
*Eq 1 : in a period of time show by range Time 1 to 6, A hit 7 first before B. then, “A WIN“
Time | A | B | A WIN
1 | 1 | 2 |
2 | 5 | 2 |
3 | 7 | 4 |
4 | 5 | 5 |
5 | 4 | 6 |
6 | 3 | 7 |
*Eq 2 : in a period of time show by range Time 1 to 6, B hit 7 first before A. then, “B WIN“
Time | A | B | B WIN
1 | 1 | 2 |
2 | 5 | 7 |
3 | 7 | 4 |
4 | 5 | 5 |
5 | 4 | 6 |
6 | 3 | 2 |
Please help me how to make this formula, its been 3 days im trying but i still cant figure it out,
thanks in advance.
By: Bill
=IF(B2=7,"A",IF(C2=7,"B","NIL")) formula for ist query A win same way for the next one too have a Nice day
=IF(AND(A2>=1,A2=7),"Awin",IF(AND(A2>=1,A2=7),"Bwin",""))
For search first instance of Awin or Bwin try VLOOKUP formula.
If you have time value (not 1 to 6 values) use TIMEVALUE formula.
hi again.
mr remind the formula you gave doesn't work.
please give me the true formula.
this is the problem.
if F15 is within 0.26-0.75 and H15 is above 0.20 the value returns to "retained"
if F15 is within 0.26-0.75 and H15 is below 0.20 the value returns to "revised"
if F15 is not within 0.26-0.75 and H15 is above 0.20 the value returns to "revised"
if F15 is not within 0.26-0.75 and H15 is below 0.20 the value returns to "rejected"
I will be glad to your right response. thank u.
=IF(AND(0.26<F15<0.75,H15#0.2),"retained",IF(OR(AND(0.26<F15<0.75,H15<0.2),AND(0.26#F15#0.75,H15#0.2)),"revised",IF(AND(0.26#F15#0.75,H15<0.2),"rejected","N/A")))
Replace # sign with "greater" sign.
Is working?
Julius,
Please send me a sample to help you.
remindfwd[at]gmail[dot]com
I solved your formula, but is better to comunicate by e-mail.
Hi,
First of all I would like to congratulate you for this wonderful site and all your efforts for making using excel much more easier than it used to be. I had started working on excel in my teens and learned a lot but you all are able to surprise me with the new ways you mentioned to tackle the issues or the innovative uses of formulas.
now coming to the point, i am having difficulty in analysing some data for my report.i have a report which states a specific purchase order code with the quantity in the very next column but the supply is being received in parts. so the system application plots all the receipt against the very same order. but when the report of the same is exported in excel, it repeats the order and quantity against every receipt thus no general formula could be used to just subtract the receipt form order and the data spread over thousands of rows so manual calculation is impossible.
for example:
Column A states order no XX/1*12
Column B states Quantity demanded to be 10000.00
Column C states the receipts in the tune of 300,1500,2500,700 & 4500.
Thus the balance should be 500 but since the values of Column A and B repeats, simple subtraction comes as 9700, 8500, 7500, 9300 & 5500 respectively for the balance quantity.
Can you suggest any possible formula or a set of formulas to derive the balance quantity after considering every aspect.
Try VLOOKUP formula in addition with others.
If you send to me a sample from your report (not real names or prices or quantities) I will try to hel you.
my e-mail remindfwd[at]gmail[dot]com
Sorry 2!
=IF(AND(F15>=0.26,F15<=0.75,H15>=0.2),"retained",IF(AND(F15<=0.26,F15>=0.75,H15 sign (First H15 and forth F15)
thanks a lot God bless (^_^)
hi. someone help me with my item analysis please.
when f15 is within 0.26-0.75 and h15 is above 0.20 the value returns to "retained"
when f15 is not within 0.26-0.75 and h15 is below 0.20 the value returns to rejected
O, thats is impardonable:
The formula is:
=IF(AND(F15>=0.26,F15<=0.75,H15#=0.2),"retained",IF(AND(F15<=0.26,F15#=0.75,H15<=0.2),"rejected","N/A"))
Replace # with "greater" sign
Sorry!
=IF(AND(F15>=0.26,F15=0.2),"retained",IF(AND(F15=0.75,H15<=0.2),"rejected","N/A"))
In the cell G17 (or where you want) insert this formula:
=IF(AND(F15>=0.26,F15=0.2),"retained",IF(AND(F15=0.75,H15<=0.2),"rejected","N/A"))
If you want to change N/A with something else, be my guest.
Hi
I am new in excel.
I have question, if I have 2 columns (column a and b), each column has negative and positive value. How can I sum if the condition is "show sum of column a and b if either column a or b are negative"?
Thank you
Hi Fanteri,
Here is the formula you can use:
=IF(OR($A1<0,$B1<0),SUM(A1,B1),"")
It says "if either value in A1 or B1 is less than 0, then sum values in A1 and B1, otherwise show a blank cell". Copy it down the column where you enter the formula to get the results for each row.
You can read more about OR condition in this blog post.
I hope this helps.
A B C
12345 10
12345 20 #NAME?
12345 LTP 30
IF COLUMN A same value, take column B as a return . answer should be '30'.
Hello Aslinah,
It sounds like you need to use subtotals in Excel, please see this blog post:
https://www.ablebits.com/office-addins-blog/subtotal-excel-insert-use-remove/
I have more than one number in the same column and between each number there is a empty cell .. what I need is to repeat the number between each number using excel formula .. please send me the formula that will help in adding the field that are not showing between two number cause I have a big data and need to add the formula also I wanted the system to check using if in case that possible .. will Waite for your reply as soon as possible .. appreciate your assistant..
I will be very glad if you can send me the formula in me email
Lets say in B1 is your value
then in B3 =IF(LEN(B1)>0;B1;"")
i have created the formula"=IF(G7=K15,L15,IF(G7=K16,L16,IF(G7=K17,L17,IF(G7=K18,L18,IF(G7=K11,L11,IF(G7=K12,L12,IF(G7=K13,L13,IF(G7=K14,L14))))))))" in ceel H9;BUT FOR MORE THAN 8 CONDITION THIS NOT WORK; WHAT TO DO SOLVE THIS PROBLEM.
I am not sure what you want to acomplish but usually if you need more then 3 ifs thats mean you are doing something wrong.
also lets say K17 = K19 it will return K19 because its first if that doesent matter then use:
=VLOOKUP(G7;K11:L18;2;0) just change your range that best serves you
if same values are problem then:
=IF(COUNTIF(K11:K18;G7)>1;"MORE THEN ONE";IF(COUNTIF(K11:K18;G7)<1;"NO MATCHES";VLOOKUP(G7;K11:L18;2;0)))
i have prepare the formula-=IF(G7=K 14,F11,E20), =IF(G7=K15,F11,E21), =IF(G7=K16,F11,E22) incell E20 TO E22; BUT THE SUM OF THE VALUES FROM THESE FORMULA NOT DISPLAY & A MESSAGE IS DISPLAYED" careful we have found one or more circular reference in your work book that might cause your formula in correctly"
Hello Sunil,
The reason why you get this error is that you are trying to get value from the same cell where you enter the formula. Please replace E20 in the formula or describe what you are trying to achieve in more detail, I'll do my best to assist you.
HI Sventana,
Thanks for another aspect of Nested if Function. Really nice and useful Information. Expecting some Detailed Article on CF,Data Validation,Offset,Index Match. Great JOB
Hi Rohan,
Thanks for your feedback! I covered some of these topics a while ago, but hopefully you will still find the information useful:
* OFFSET function in Excel - formula examples
* INDEX MATCH as a better alternative to Excel VLOOKUP
* How to create a drop down list in Excel: static, dynamic, from another workbook
* How to make a cascading (dependent) drop down list