IF is one of the most popular and useful functions in Excel. Generally, you use an IF statement to test a condition and to return one value if the condition is met, and another value if the condition is not met. Continue reading
by Svetlana Cheusheva, updated on
IF is one of the most popular and useful functions in Excel. Generally, you use an IF statement to test a condition and to return one value if the condition is met, and another value if the condition is not met. Continue reading
Comments page 63. Total comments: 4830
Hi
I need to asign a value to prices which falls in a specific range
0-50000 = Level 1
50001 - 300000 = Level 2
300001 - 500000 = Level 3
This is what i did, but that only gives a value for the first level.
=IF(E2:E10<=50000,"Level 1", "Other Value")
Hi, Johan,
please try this formula:
=IF((COUNTIF(A1:C1,"<=50000"))>0,"Level 1",(IF((COUNTIF(A1:C1,">=50001")-COUNTIF(A1:C1,">300000"))>0,"Level 2",(IF((COUNTIF(A1:C1,">=300001")-COUNTIF(A1:C1,">500000"))>0,"Level 3","")))))
Please note that the first criterion will be checked at first, and if there's at least one cell in the range that falls under this criterion, the rest won't apply.
If you need something other than that, please specify.
Hope it helps.
Hi,
I am trying to create a spreadsheet to calculate high school grades using the weighted average and weighted percentage method.
My problem is, I want to show that if a student is absent for 1 or 2 assignments or tests, they will not be penalized in their average assignment grade.
How then can I write a IF function to show this calculation?
Thanks for your usual assistance.
Hi, Hamack,
for us to be able to assist you with an approximate formula, please specify the names of the columns you have, what values are stored there, and how you indicate that the student was absent.
Thanks!
Hi, I'm creating a formula that once your if you change status to Complete in column B, then column C will provide the current date
Hi, Nyleve,
if the status is in B2 and you need the result to return into C2, here's a formula:
=IF(B2="Complete",TODAY(),"")
Then copy the formula down column C.
Please note that if B2 doesn't contain "Complete", C2 will remain empty.
I have two workbooks that I am trying to link together. The first workbook is Participants' Weight. The cell I am looking at is G2. If G2 is blank, I want to only add cells C3, E3, G3, and I3 on the second workbook (Nutrition and Fitness). If G2 has a value, I want it to add that value PLUS C3, E3,G3, and I3. Can you please help with my formula? This is what I have..
=IF(ISBLANK('Participants'' Weight'!G2),=SUM('Nutrition & Fitness'!C3+'Nutrition & Fitness'!E3+'Nutrition & Fitness'!G3+'Nutrition & Fitness'!I3),=SUM('Nutrition & Fitness'!C3+'Nutrition & Fitness'!E3+'Nutrition & Fitness'!G3+'Nutrition & Fitness'!I3+'Participants'' Weight'!G2))
Nevermind, I figured it out!
=IFERROR(INDEX(Tbl_Task2[Activity Actual Start Date],MATCH($B4&X$1,Tbl_Task2[Activity ID]&Tbl_Task2[Task Name],0)),"")
How do I make the dates come out as blanks using this formula?
Hi, I'm trying to create a schedule for our workers using the schedule for our kids. I'm trying to figure out how to put in a formula that says " If Cell A3 on Sheet 1 equals "JohnDoe" then cell A2 on Sheet 1 will be copied to cell A2 on Sheet 3". Is there a way I can do this?
=IF(Sheet1!A3="enter text here", Sheet1!A2, " ")
Enter this formula into A2 on sheet 3. Where it says "Enter text here" you can either enter the text you want to use or take away the quotations and enter a cell like B2...
Drag the formula all the wya down
Thanks very much for your participation and help, Jackie! :)
=IF(SQRT(BP22-(BS22/BS23))+0.5>=BY19,0.95,SUM(BY22))
Hi,
I want to generate an expression that basically states that if the number in cell BY22 is not greater than 0.95, then this figure is to be used. The expression is being placed into BY22.
Please help!!!!
Cheers
Paul
Hi, I have a spread sheet with validated filtered lists and I need help constructing a formula that will add 14 or 28 days to the current date for a smart target review depending whether I select 2 week review or 4 week review.
the current date is displayed in cell A19, the two week review in G21 and the four week review in G22. the answer will appear in cell G20 and should display the result of todays date plus 14 or 28 days displayed as a date. thanks if you can help.
Hi,
I wantto select one value from a set of values which is there in column and if it matches to the logical statement, then it should take the corresponding row value as true result else some zero.
SWG Dia with enamel, mm Area of bare conductor, mm^2 R/Km@20oC ohms Weight Kg/Km
8 4.219 12.97 1.3 116
9 3.8 10.51 1.6 94
10 3.383 8.302 2.1 74
11 3.068 6.818 2.5 61
12 2.756 5.48 3.1 49.22
13 2.441 4.289 4 38.56
14 2.129 3.243 5.3 29.15
15 1.92 2.627 6.6 23.64
16 1.709 2.075 8.3 18.678
17 1.501 1.589 10.8 14.313
18 1.293 1.167 14.8 10.537
19 1.082 0.8107 21.3 7.324
20 0.978 0.6567 26.3 5.939
21 0.874 0.5189 33.2 4.702
22 0.77 0.3973 43.4 3.607
23 0.665 0.2919 59.1 2.655
24 0.612 0.2452 70.3 2.233
25 0.561 0.2027 85.1 1.851
26 0.505 0.1642 105 1.499
27 0.462 0.1363 126.5 1.245
28 0.417 0.111 155.3 1.014
29 0.384 0.09372 184 0.8559
30 0.351 0.07791 221.3 0.7121
31 0.33 0.06818 252.9 0.6245
32 0.307 0.0591 291.7 0.5408
33 0.287 0.05067 340.3 0.465
34 0.264 0.04289 402 0.3932
35 0.241 0.03575 482.2 0.3281
36 0.218 0.02927 589.1 0.2686
37 0.198 0.02343 735.9 0.2202
38 0.175 0.01824 945.2 0.1679
39 0.152 0.0137 1,258 0.1262
40 0.142 0.011675 1,477 0.1079
41 0.132 0.00981 1,758 0.0908
42 0.119 0.008107 2,127 0.075
43 0.109 0.006567 2,626 0.061
44 0.097 0.005189 3,323 0.0481
45 0.086 0.003973 4,340 0.0369
e.g SWG = 39, select 0.0137 as true else 0
SWG = 40, select 0.011675 as true else 0
Please give solution.
Thanks & Regards
Ajeet
I am trying to get a spreadsheet to calculate a time penalty for a certain class in racing. The time penalty formula is =+IF(AND($A33="",$B33=""),"",IF($B$5=0,IF(K33="","",K33),IF(K33="","",IF($B33="A",K33*$B$5,K33)))), however if I enter a DNS or DNF (did not start/finish) in cell K33 then the formula comes up with a #value error because it expects a time value in K33.
This only causes an issues where B33=A.
So basically B5 is a percentage time penalty, column K is the actual time taken for the race and for a specific class of vehicle we need to add a time penalty.
There may be 6 heats, one heat the vehicle may not have finished, so instead of a time entered it is DNF, but this will not multiply the time penalty. What I want is for the adjusted time column to show DNF as well but it won't because of the calculation it is trying to do
Hi
I'm trying to get an IF formula to work but I am having trouble. I'm trying to do an IF formula for both cells. I want the formula to return the number 2 if cell D7 is not blank (ie has data in it), return the number 6 if cell E7 has data in it or remain blank if neither of them have data in. Can anyone help please?
=IF(D7>0, "2", IF(E7>0,"6"," "))
I am not sure if this is what you are asking
Hi,
I try to do like, =IF(A1="no","no need to fill in the blank", "") and If the A1 = "yes" I need to fill in the blank. How to do that? because if I do like above IF statement, the IF statement will gone when A1 = "yes" after I filled the blank.
=IF(A1="yes", "Fill in the blank", IF(A1="No","Do not fill in the Blank"," "))
I need a formula that can place the date from sheet 1 on sheet 2 when a number value is greater than or equal to a set number. The date would be in the same row in sheet 1 as the number. Example sheet 1 column A row 1 (5/5/17 entered) column B row 1(405 entered) set value is 400. 5/5/17 would then be shown in cell choosen on sheet 2.
Example:
=IF(405>=400, Sheet2!A1, "" )
Example:
=IF(405>=400, Sheet1!A1, "" )
The number in an Excel cell in the formulator to select a cell like?
for example
Ten is the number in cell a3
Five is the number in cell a4
Three is the number in cell c5
Four is the number in cell c6
Now we want to write the formula:
=a(c5)
The c5 gets three
And ac5 gets a3
Which is equal to ten
How is this done?
Thanks
ID NO- M123, M124, M125, F126,F127
WHAT IS THE FORMULA IF THE GENDER IS BASED ON THE EMPLOYEE'S ID NO? IF THE ID NO STARTS WITH M, THEN THE EMPLOYEE IS MALE, F IF FEMALE
I need help for this thankx.if cell b1 greather than 0 then add A3 and B2 if not return A3 VALUE in b3 .
use the or formula within cell B3...
=IF(0>B1, B2+B3, A3)
I am trying to use an if/than stmt and change the color of the cell based on that stmt. example if the cell is greater than or equal to than $1000 i want the cell to turn green
Use the conditional formatting tool. Any number great than or equal to 1000 turn green.
Hello,
need to create a formula that would, if not manually entered number in cell, the formula would read data from other cell.
example:
in cell A1 if i type 10 it says 10, but if i skip it then it would read from cell D1 where i get the number from some equation.
Thank you
Hello, Alen,
I believe, the formula below will help you:
=IF(ISNUMBER(A1),A1,D1)
It will return any numeric value from A1, but if there's a text in A1 or it's empty, the formula reads D2 then.
It did,
thank you very much !
You're welcome! :)
i need to create a formula that, when i click "yes/no" in one cell, I get the answer in another cell. the formula is complex but not sure how to navigate this.
HELP!
Hello, Greg,
if your first cell (let's name it A1) has only two options - Yes and No, your formula should look like this:
=IF(A1="Yes",""Answer_for_Yes","Answer_for_No")
If A1 may remain empty or contain other value for which you don't want anything to return, then:
=IF(A1="Yes",""Answer_for_Yes",IF(A1="No","Answer_for_No",""))
You can learn more about nested IF function on our blog page.
Hi,
Need help for this formula.
Duration: Must be more 60 Seconds.
Status: POOR, GOOD, EXCELLENT.
Condition:
IF duration 60 seconds, but the Status = "POOR", then need to check.
My current formula:
=IF(A2<60,"POOR",IF(B2="GOOD","OK",IF(B2="EXCELLENT","OK"
I'm stuck with that.
Thanks.
Hi,
if I understand your task correctly, this formula should do:
=IF(AND(A2<60,B2="POOR"),"NOT OK",IF(AND(A2<60,B2="GOOD"),"OK",IF(AND(A2<60,B2="EXCELLENT"),"OK","")))
If it's not what you're looking for, please describe in details what values you already have and in which cells, and specify your condition for when there's poor/good/excellent in B2.
Hi team,
Why if functions excepts text greater than any number value? if I write values in A1 -100, A2-200, A3-300 and write function in B1 =if(A1>=250,"Fine",if(A1>=100,"Not so bad","")) when instead of 100 i write in cell A1 text NO VALUE - if function returns me "Fine"
Thanks
up,, any info about why text values are greater than number values in logical functions?
I am trying to write that if there is a 1 in Column B2 then write "refer to page 34". I have been using =IF(B2=1, "refer to page 34"). This works great when there is a 1 in the reference column but when the column is blank I keep getting a False statement. Help please
Hello, Dave,
The point is that IF function uses 3 arguments. You specified what to return when the value is 1, but you didn't for when the value is not 1. If you need the cell to remain empty in that case, please try this formula:
=IF(B2=1,"refer to page 34","")
Hope this helps!
Hello Ma'am Svetlana:
Good day.
Ma'am, I am working on a database using excel. In an if statement, how can I return the address of a particular cell if argument is true. The statement should go like this, as an example, "Please check entry in cell G26"
The cell "G26" is the cell address being referred whose entry should be checked if argument is true. The formula will be repeated in the rows of the database therefore it is expected that when the formula is copied to the succeeding rows, excel should automatically adjust the row (the 26) corresponding to the row where it is pasted. This will spare me from editing the formula every time it is being copied into a new cell on another row. Is this possible?
I managed to get a returned address of a cell but it doesn't automatically update once copied to another row and so need to keep on editing. Besides, if possible I wish to get an address which is relative (G26) not absolute ($G$26). Also, I wish that the column would be in alphabet, not number.
Thanks in advance for any help I can get.
Required formula for below condition
Final result depend on 6 column status example as below
If cell A1=2, and B1=2,C1=2,D1=2,E1=2,F1=2 result should be “U”
If cell A1=1, and B1=2,C1=2,D1=2,E1=2,F1=2 result should be “V”
If cell A1=1, and B1=1,C1=2,D1=2,E1=2,F1=2 result should be “W”
If cell A1=1, and B1=1,C1=1,D1=2,E1=2,F1=2 result should be “X”
If cell A1=1, and B1=1,C1=1,D1=2,E1=2,F1=2 result should be “Y”
If cell A1=1, and B1=1,C1=1,D1=2,E1=2,F1=2 result should be “Z”
There is so many permutation and combination but I need above combination in single formula
The following vlookup function
=(VLOOKUP($E12,'SPORTS'!$A$9:$G$162,6,FALSE))
returns the value as "#N/A" because the data is not available in the "SPORTS" tab. How can I change the value to "0" from "#N/A"?
Thanks
=IFERROR(VLOOKUP($E12,'SPORTS'!$A$9:$G$162,6,FALSE), "0")
Hello Team,
"If value of Cell d4 between -5 to +5 then display "Correct" Else "Error".
Kindly help me with a formula for the above condition.
Thanks in advance.
If you have Excel 2013 or higher, use the conditional formatting tool.
Hi, I am trying to use multi IF function to show certain range of values. for the numbers I have got it right but when it comes to text it is not reading it. this is the formula:
=IF(AS55<=(AS54*0.92),20,IF(AND(AS55=(AS54*0.92)),50,IF(AND(AS55(AS54)),80,IF(AS55>=(AS54*1.05),95,IF(AS55="s/d",330,331)))))
The idea is to show cut-off values where eg.if the number I get in the cell is <92% shows 20. However, if it is just a text "S/D" then it should read =330. can you help please.
Note: It is working for me as single IF function but in the combination it is not reading it!=IF(AS55="s/d",330,331)
I want to achieve three outcomes from three arguments. I am attempting to compile a register containing current insurance policies. The policy dates are either current (OK), out of date or not provided at all.
1. TODAY()
2. Date registered (A4)
2. OK (A5)
3. Out of date (A6)
4. Not submitted (A7)
My attempt: =IF(TODAY()A4,"A6",IF(ISBLANK(A4),"A7")))
This doesn't work and I suspect I don't understand functions well enough to achieve my desired outcome. Can you assist.
Oops typo. Should be =IF(TODAY()>A4,"A6",IF(TODAY()<A4,"A5",IF(ISBLANK(A4),"A7")))
Hi I need help in applying if function for a range of cells which contains percentage and text. Ex. A1 contains 100% and B1 contains NA; while I applied if function, if(A1=>100%,1,if(A1<100%,2,0)), which worked when cell values had percentage but gives wrong output if cell contains any text, gives 1 for NA as well. Kindly assist.
Please help on this
=if(A3=E1&B1=C1, D3*G3,0)
SIMILAR ABOVE I WANT TO CREAT.
=if(A3=E1&B1,C1, D3*G3)
Hello Team,
Can any one help with, Actually i want to find the things from 3 column,
Eg i have 50 Servers list those i need to find from 1000 D column list which i can find by using =vlookup function but every servers having its status with retired, Decom, Active in H column, So i need to find if Server in D column status in H column with Retaied or Dcom then find as true.
Hello Rajesh thanks for looking into it, i have drop an email with my concern. Hope that clear to you.
How to write the IF function in case of a dubble letter column.
For Example
=IF(AA18="";"Close";"Open")
I get a ?NAME error.
=IF(AA18="","Close","Open")
=IF(AND((FM22)>Q2,(FM22)<R2),1,0)
Hello,
I do not think any of the examples contain what I am after. I have Excel 2010 Pro Plus. I have a column of dates, I need a formula that will fill the empty cells with 01/01/1900 00:00:00 AM if they are empty, otherwise I need to keep the existing date. I do not seem to be able to find this any where.
Could you help, please?
Regards,
Paul.
Ok I need to look at 3 cell Column A, B, C. In D I figured out the first part IF(A1=B1,IF(B1=C1,A1,A1&"/"&C1),A1&"/"&C1). In E I figured out the second part IF(A1>B1,IF(B1>C1,A1&"/"&B1&"/"&C1,A1&"/"&C1),A1&"/"&C1). In F I tried to combine the two I have IF(A1=B1,IF(B1=C1,A1,IF(A1>B1,IF(B1>C1,A1&"/"&B1&"/"&C1,A1&"/"&B1&"/"&C1),A1&"/"&C1)),A1&"/"&C1). It works but not for all my number combination If A and B are the same or If B and C are the same it give me A B and C. I think I need a third part not sure. If A B and C are the same I want A. If A B and C are all different I want ABC. If AB or BC has the same number I want AC not ABC which is what I am getting.
I need to check if a cell is blank then if another cell which is a date is past 30 days then change it to red
Hi guys, Please assist with IF formula. 1. I wanna compare two columns and isolate all the numbers that are not duplicates into a separate column.
2. I also wanna compare the isolated numbers to another column that has data.
Example
Column A *Column B Now the odd one out must go to Column C
1234 1338 1338
1245 1245
1336 1336
There after I would like to again see if column C data is not in another column, say Sheet 2 Column F
your assistance will be highly appreciated
Hi, Andy,
for starters, if the data begins from A1, you can enter the following formula into C1:
=IF(A1<>B1,B1,"")
and copy it down the column to isolate all non-duplicates.
Then you can use one of these ways (to your liking, depending on what result you want to see) to compare column C with another one.
Hi
Could you please help me to find a solution for the below , I have made table in excel sheet like below, and Ihave nade aut list in colum a (Cash,Card, Cheq) what I need from ecel is if I select cash mode from colum a the amount what Iam entering cloum b should come in colum c automotically if I select card , colum b amount should come in colum d ,if select cheq colum b amount should come in cloum c.
which formula I want to apply in order to work this table ?
A b C D C
mode rent cash card chq
Hi all,
I'm not even sure how to create a IF function for the following .. PLEASE HELP!
I am trying to create a IF function formula.. if someone can help me create.
If between 1-3 years you get 10 days
If between 3-6 years you get 15 days
if between 7-9 years you get 17 days
if 10 plus years you get 20 days
After your 10th, every 5th year anniversary you get an extra 5 days for example 15th year you get 25 days, 20th year so on...
How to create an if then statement that follows as such:
If A5 = "Orange" AND B5 = "Banana" then populate in C5 "Fruitbasket" with yellow background
Hello, Gary,
to highlight your cell, you need to create a Conditional Formatting rule:
=AND(A5="Orange",B5="Banana")
and apply it to C5.
We have an easy tutorial on how to create the conditional formatting, please take a look.
I'm trying to do monthly columns from a previous column in same spreadsheet with random/multiple dates; pulling a dollar amount from ea month into it's own months' column. Is this possible?
Hi,
Could you help with the following that I want use in conjunction your Merge Two Tables Add In? I read through your "IF function in Excel" page and the comments but don't see an answer to my problem:
I have the following headers for columns A to F
Appointment Status, Session, Date, Consumed, No Show, Balance
In column A I have 3 states: Complete, No Show, NoShow NoEmail
In column B I have various possible text strings: e.g. "PhonePill Flexi 20" "PhonePill Flexi 30", "PhonePill Flexi 40" the last number represents minutes.
In column D, I used this formula =RIGHT(B2,SEARCH("",B2,2)) to show that last number from the column B text string: 20, 30 or 40
However, what I really want is for those numbers to go in the appropriate Consumed (D) or No Show (E) column: i.e. if the Appointment status =Complete the number should go in column D. If the Appointment Status= No Show or = NoShow NoEmail, the number should go in column E
Thanks for your help.
Hi , could some one help me to create a formula please
i have two products alloy and carbon steel. these have composition in maximum and minimum range in percentage . if composition is different then given minimum and maximum range result of formula should say pass or fail . range is :
Steel Type Carbon Manganese phosphorus sulphur nickel chromium
Carbon Steel Max 2.1% 1.5% 0.5% 0.3% 0.25% 1.5%
Min 0.5% 0% 0% 0% 0% 0%
Alloy Steel Max 1.5% 5% 1% 1% 5% 15%
min 0.5% 0% 0% 0% 2% 11%
HOW TO USE IF FORMUALA IN CASE OF
C=COMP
P=IND
OTHER ALFABATE IS =FIRM
Good Day
I have managed to ad the if formula no problem. thank you for that.
How ever I would like the cell background to turn green if the result is favorable.
regards
Leanne
Hello
I want to create a list to automatically fill in my prices. I have two values to look at: 1. is the size of the item. 2. is the description of the item.
Ex: 10 Straw
So it looks up "10" which refers to a pricelist.
Then it looks up "Straw" from the list it was just referred t by the number.
It then should return a price that is in the list.
Any ideas?
Having a dropdown would be even better. So you can choose your size form a list, and then in the next cell choose the item that is in that list.
Thank you in advance,
I am trying to write a formula in E5 where if D5 is > $5,000.00 then subtract $5,000.00 from D5, if not then blank.
Thanks,
Larry
Hi Larry,
Here you go:
=IF(D5>5000, D5-5000, "")
Hi,
I'm looking for a way to get an average from a set of values with "<" contingencies. For instance I need the average of cells A1:A6. If <10 is present I would like to use 5 instead. If there are "<" than I would like it to use the values given.
thank you in advance
-Esmeralda
Hi.
I have been googeling this for some time now, and cant find out how to:
check if the cell value is less than another cell value, and if it is, add a cell value to the first cell.
A1 = 120, A2 = 200, A3 = 300. I need some function to check if A1 is less than A2, which it is, and then add A3 to A1, so A1 becomes 120 + 300 = 420, and is no longer less than A2.
if anyone have an answer for this, i'll be very thankful.
thank you in advance.
- Morten
Hi, Morten,
I'm afraid you won't be able to put the formula in A1 and reference A1 at the same time. You will have to enter the formula to some other cell, say A4, to return the result:
=IF(A1<A2,A1+A3,"")
Also, note that if A1 is not less than A2 the cell with the formula will remain empty.
Cell A1 Data like this "10+10"
i want the result in B1 like "20"
which formula i want to use. anybody help?