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 59. Total comments: 4830
Thanks again
Hi friends,
kindly guide me for solve the problem i.e. "i need answer of a employee attendance it is in excel sheet that have P for present and .75 is leave of 1/4 and .5 is half day how can i solve it ?
Lokendra Sahu P L P P P P P P L P 0.75 P 0.50 P P L P P P P P P L P P P P P P L P 24 7.00 0 31
I have a cell (say A1) contain values like this format:0.453, 0.583, 0.383. I want to get each number from cell and compare if they are > 1. And I write this for 1st number(0.453): =IF(LEFT(A1,5)>1, 1, 0)
It return 1 which is not correct. I check "LEFT(A1,5)>1" can return 0.453. Thanks for your advice.
I have the operation like this:
=if(A1=8,50,"")
What will i do if i will add the operation like A1 =0,0
How do i include that on my operation. Thanks thanks
i have to calculate overtime data
OE Names Orders Processed Target Extra Orders
Amit Singh 38 40 -2
Now i only want to pay overtime if my team members have met the target and they can get the overtime paid for whatever extra orders they have processed else the variance cell should indicate 0 for not having earned any overtime.
Hello,
I'm using excel 2010.
In cell D2 is a date. F.e. 07/08/2017
In cell G2 is a value F.e. 38
I would like to use a formula in cell I2, which will give me the value from cell G2, if the date in cell D2 is greater or equal than 28/08/2017.. I am currently using the formula: IF(D228/08/2017;G2;IF(D2<28/08/2017;""))
So normally in my example, the outcome should be "" because the date in cell D2 is smaller than 28/08/2017 but it doesn't...
Hello, Glenn,
please try the following:
=IF(D2>=DATE(2017,8,28),G2,"")
You may want to check the rules of using DATE function and of working with the dates in Excel in general.
Hope this is what you need :)
Natalia,
I have been struggling with date ranges within IF formulas, but your response to Glenn helped me greatly. Many thanks.
I have used a simple IF statement to identify Pass/Fail conditions.
IF(I4>1, "FAIL", "PASS"). As long as I4 contains actual results, this works fine.
But sometimes there is text in I4 (see note, etc.). Since the text is not >1, the result should be PASS, but I'm getting FAIL.
So I turned it around: IF(I4<=1, "PASS", "FAIL"), but the results are the same, FAIL when there's text in I4.
Can you explain this?
(Still) using Excel 2003 (I hate the ribbons).
Thanks
Hi,
You need an additional condition that will check if the values in I4 is number. Please try the formula below:
=IF(AND(ISNUMBER(I4),I4>1),"FAIL","PASS")
You can read here how AND logic is used in formulas.
Hope this helps.
Hi
I have value in a cell(A1) like "01-USA" (This is fixed Cell Value)
Another Cell(A2) value is changing as per country selection but sometimes value comes same as in fixed cell. Please note both cells have text value only.
so I want following results
If A2 value is same as A1 then result like 10-5 =5
If A2(02--Canada) value is different from A1(01-USA) then result must be Blank
Thanks in advance for your help.
Hi, Surya,
as far as I can see, you have all the conditions to build a nested IF. Please check this tutorial to learn how it's made. There are lots of examples as well.
Also, in case you don't know how to show if the values are not equal, I'd recommend you to look through this article as well.
Hope these pieces of info will help you solve the task.
Hi Sveltalana ,
I have 2 cells with dates(A2, B2) , i would like B2 to highlight if it is larger than 180 days / 6 months than cell A2
Hello, Anat,
to highlight one cell depending on the value of the other one, you need to use conditional formatting. Please read this article of ours to learn how to use it.
Also, please take a closer look at this point of the article above to see how the dates work with IF.
Hope you'll find the information helpful!
what would be the formula
if the sum total in C10 is less than or equal to 300 the cell should show 300 but if C10 is greater than 300 then it should pick the C10 value.
can you help me in this
Hi, Rakesh,
here's a formula:
=IF(C10<=300,300,C10)
I am trying to produce a number in a cell.
The number must come from column F when then column C and column N match a specific text.
The formula I have tried only give FALSE results.
=IF(AND('Sheet1'C:C="XYZ", 'Sheet1'!N:N="ABC"), 'Sheet1'!F:F, "N/A")
Any help would be appreciated.
Hello, David,
I'm afraid this formula won't work like this.
If you need to return only one number from each F cell, you need to use a separate formula for each separate cell, like:
=IF(AND(‘Sheet1’C2=”XYZ”, ‘Sheet1’!N2=”ABC”), ‘Sheet1’!F2, “N/A”)
(you can place the formula into one cell, and copy it down the column)
Ii you need to perform some mathematical operation with the found values, you need to enclose the whole IF formula into COUNT, or SUM, or AVERAGE, or some other function depending on the operation you need. In this case it is an array formula. It is entered by pressing Ctrl+Shift+Enter on your keyboard instead of just Enter.
Hope this helps!
Hi,
I have a workbook consisting of two worksheets.
On worksheet one I record who has taken what showing quantity and sizes.
On worksheet two I am keeping a usage report of those same items handed to numerous contractors(stock, ppe etc) showing size and quantity usage.
I want a formula put on w/s 2 cell Q4 that if on worksheet 1 in block C4 the value is "S" then the value of q4 must be the same as the value in D4 on w/s 1.
Can you help please.
Thanks
Emcee
Hi, I have a problem while using IF function.
IAm trying to use if function Column B & C with a formula that if column B contains CLOSED than C should be CURRENT date and the formula is " =IF(B2="CLOSED",TODAY(),"") ".
It is working correctly, however, while opening the excel sheet in the next day, it is reflecting the current day and it is not reflecting the date which I actually enter CLOSED in column B on the particular date.
Can someone please help me to fix, what exactly am I doing wrong here?
Thanks,
Paddy
Hi,
I was looking at doing a formula like the below;
=IF(ISNUMBER(SEARCH(”P”,D19,3)),(VLOOKUP(D19,'Rates Summary '!A$2:Q$1573,2,0)),D19)
Basically, I have a code "QAPLI0" in cell D19. What i want to do is convert this to a QAR code which is what my Vlookup is for. Only problem is that when i already have a QAR code in the cell D19 it still brings me back a QAP instead of leaving it was whats already in the cell D19 which is what i though i had down as the "value if false" part of the IF statement.
Am i making sense? I tried to use a FIND instead of SEARCH but got the same result. Am i missing something here?
Any help would be great.
Thanks
Jon
Hi, John,
Please note that you have smart quotes instead of double ones in SEARCH(”P”
If this is the way the formula is written in Excel, ISNUMBER will always return false.
Also, ’Rates Summary ‘ has space at the end.
If this doesn't solve your problem, please send us your workbook to take a look at to support@ablebits.com. Please don't worry if you have confidential information there, we never disclose the data we get from our customers and delete it as soon as the problem is resolved.
So I am trying to make a call schedule for my work and am having trouble creating a formula that will help me. What I am looking to do is have the Initial Call date (A) and a column for the call back date (B). I want excel to fill in the call back date for me (B) for a certain length of time per my customers buying level.
Ex: If customer is "gold level" (C) and the initial call date (A) is 1/1/2017 then call back in 30 days or 1 month (2/1/2017) (B) or,
If customer is "silver level" (C) and the initial call date (A) is 1/1/2017 then call back in 60 days or 2 months (3/1/2017) (B).
Can this be done? Thanks for the help!
Hello, Jon,
You need to create a nested IF formula, something like the following:
=IF(C2="gold level",DATE(YEAR(A2),MONTH(A2)+1,DAY(A2)),IF(C2="silver level",DATE(YEAR(A2),MONTH(A2)+2,DAY(A2)),""))
Please read this point of the article to know more about adding months to a date.
Hope it helps!
For one of our lab tests, we take 2 weights. The second can't be more than 0.4 away from the first. If it is, then we have to do a third weight. I need the "residue" cell to calculate depending on that. If the second weight is within 0.4, I need it to use that. If not, there will be a third weight entered, and I need the "residue" cell to calculate based on that one. Can anyone help?!?
Oilgaztreyd LLC has been in business of production, marketing and exporting of all petroleum and petrochemical products for the past 15 years. We have been an established and popular company with an excellent track record for the best customer satisfaction. We have never compromised on the quality and the services provided to the customer. We believe in keeping the customers happy and providing them with products at a very competent price. We have an excellent staffs who will guide you with their best ideas by keeping in constant touch with your company and informing about the market trends. We are also interested to establish a mutual business relationship with buyers, facilitators and resellers all over the world with basic aim of supplying them with our products such as follow D2, jetFuel A1,JP54,Mazut M100,D6,Base Oil and Bitumen.
Also we work with other foreign partnered refineries in allocation production.
Regards,
Julian Alessandov
Email:oilandgaztreyd@mail.ru
Email:oilandgaztrey@yandex.ru
Hi All,
I need to come with an IF formula for the following- it keeps telling it too many arguments
IF 76=170 >141=200
Hi, Ana,
I'm sorry, it's not entirely clear what result you want to have.
Please take a closer look at the syntax of the IF function to understand what you're missing or to adjust your conditions accordingly.
HI,
CAN YOU SUGGEST ME FORMULA FOR THIS:-
A B C D E
INPUT OUTPUT BALANCE LIABILITY
1 IGST 150000.00 175000.00 -25000.00
2 CGST 57500.00 37500.00 20000.00
3 SGST 57500.00 37500.00 20000.00
1. PUT A FORMULA IN E1, IF D1 IS LESS THAN 0, THEN D1 CAN TAKE BALANCE FROM FIRST D2 THEN D3, IF NOT LESS THAN 0, THEN NOTHING.
(LIKE IF D1 IS -25000, THEN D1 TAKE BALANCE OF 20000 FROM D2, AND 5000 FROM D3, THAN E1 BALANCE IS 0, E2 BALANCE IS 0, E3 BALANCE IS 15000.)
Hi guyz,
can you guys help me with a formula that can work with time.
my situation is that i have to add 15 mins to people time who come after 8:04 am if they come before 8:04 am it should read 8:00.
I didn't make my example ,clear. I have column "A" with these numbers 5 4 2 3 6 7 - In column "B" I have these numbers 30.92 , 31.29 , 31.11 ,31.17, 31.29, 31.07 If i select a number in column A or an adjacent number I want the minimum corresponding number in column "B" I need a formula for this. I tried this formula but all i get is zero.=MIN(IF(A4:A9>4,A4:A9<8,B4:B9)). i used control, shift, enter.I added some commas between some of the numbers to make it clearer.
Hi All,
I am looking for assistance in developing one syntax where there could be three different conditions. Those conditions could be -
1. If Date Is not crossed then Display date
2. If Date Is crossed and status is not updated then "Planned Date Crossed, No status updated"
3. If Date Is crossed and status is updated then Variance number between Plan Vs Actual Date.
Excel have to verify certain details in the table before these three conditions could be verified. So one may have to use index match formula for the same.
Also, the single cell number format should change automatically based on the cell value which could be date (First Criteria), numeric (Second Criteria) and text (Third Criteria).
It looks pretty tough to me. Can anyone help on the same.
Best
Hi there,
Can help me on this question.
Cell B Cell C Cell D
Point Eastings Northings Row 2
1 567768 6376890
2 567702 6376035
3 567835 6377836
4 567936 6376471
5 568035 6376044
6 566834 6377837
7 567413 6378635
8 566036 6378999
9 568634 6377941
10 566345 6376534
1st Point
2nd Point
Diff East
Diff North
Distance
I'm trying to use vlookup to calculate the distance between two points.
I need to be able to choose any point I wish and type that into cell D14 (starting point). Then the same thing for the end
point in cell D15. The difference between eastings and northings of both slected point will be display in cell D16 and D17.
The distance (=SQRT(DiffEast^2 + DiffNorth^2) between two points will be displayed in D18.
hii
Hi,
I am trying to use the if function but I am trying to use it for 3 different results
if a number is lower than 18 if should say approved
if it is between 18 and 24 it should say approaching
and if the number is larger than 24 it should say finished
I was able to use this formula like this
=if(A2<18, "approved", "") that is what I am using but the problem is that the numbers contantly change and I need for it to include the 3 posibilities but this formula does nto allow me.
Please help
Hi!
I've been identifying non-integer numbers on large datasets using this formula (cell F2 for example):
=IF(INT(F2)=F2, 0, 1)
It works great...until you drag the function past 44,000 or so rows, and then it stops working.
Any suggestions why or a workaround?
Thanks in advance!
I am working on putting my budget on excel, and not sure how to have adding the amounts as they are enter to the correct category.
=IF( EXACT(F6:F200,"Car Insurance"),0,SUM(G6:G200))
what I am trying to accomplish here is that when i choose my category on F6 TO F200 from a drop down list, Car Insurance is an example, but i have electricity, cell phone, groceries, etc. After i choose my category next to it n G6 TO G200 I enter the expense amount for that day for that specific category. I want to create an statement that say if f6=ELECTRICITY, then use add G8 put it on another cell, b6, etc, if f6=cell phone, then add G6 to b8, etc.
Trying to determine the lowest rating for a given security with two different ratings. If A1=Baa1 and B1=A3, the formula should return a value of Baa1 given the following hierarchy of ratings from highest to lowest (Aaa, Aa1, Aa2, Aa3, A1, A3, A3, Baa1, Baa2, Baa3, etc.). Thanks.
plz help me...
1000000< marks 1, other every Lilian 1 marks and full marks 06
Mine seems simple. I need
Formula in H10
If C10 contains "Payment" Then enter the sum that's in G10 into H10
So if it's a payment I need the sum to move right one cell
and yet I cant figure it out.
Thanks
I DID IT!
=IF(C10="Payment",G10,"0")
I have an interesting question and I am not sure if it is even possible.
Can this be done? IF cell A1 = PR Then INCLUDE a 0 in Cell B1
What I am trying to accomplish is adding a 0 to a zipcode. For example the state PR has zipcodes that begin with a 0 so if the cell has the text PR then INCLUDE a 0 to the cell that contains the zipcode.
Is this possible?
I am looking to join two cells together but separate the two values by a comma into a new cell.Can someone supply an =if statement that would help for this?
Hi there! I do this often to combine two cells with only a space separating and it's super easy. You simply add a new column and within that new column, you type in "=G2&","&H2" . The G2 & H2 simply represent the cells you want to combine. What you have in between the quotations is what is entered in between the combination, etc. Then do a drill down down the column for all others and you're all set!
Hi,
I'm Looking IF Formula For My Expense Sheet For Example In B1 I Write Anything Accept Leave Of Day Off So In C1 I Need Number 200 & When In C1 I Get 200 So In D1 Automatic I Get 250.
Looking for Your Reply.
Sir/Madam,
While awarding grades to particular mark range, I want a '-' where the marks are zero . I applied this formula but it doesn't seem to work.
=IF(BX9>90,"A1",IF(BX9>80,"A2",IF(BX9>70,"B1",IF(BX9>60,"B2",IF(BX9>50,"C1",IF(BX9>40,"C2",IF(BX9>32,"D",IF(BX9<=32,"E",IF(BX9=0,"-",IF(I8="AB","AB"," "))))))))))
Kindly guide me.
Thanks in advance .
Malar
Dear Malar as I have understood IF function it has three parts. Logic (greater, equal, less than etc), true or false parts. What you are trying to do is to put 10 IF functions in one cell. So I think it will not work. If you want to put "-" where marks are zero use this
IF(BX9=0, "-", "")
if BX 9 is zero it will return - value in cell other wise it will be empty.
or use IF(BX9=0, "-", BX9) it will return original value if its not zero.
As I understood you what you are trying to do is not possible with IF function. You have to find other function for this.
If values in A1:A10 are in numbers and values in B1:B10 are alphabets. some of the values are empty between B1:B10 like B3, B4, B7, B8. how to calculate values of A3, A4, A7, A8 with formula.
I am trying to add a column of money if the number opposite = the number 50
=IF((J44:J55=50,sum(I44:I56),0)) - but this doesn't work
Tks in advance.
=SUMIF((J44:J55,"50",I44:I56)
I am trying to add a column of money if the number opposite = the number 50
=IF((J44:J55=50,sum(I44:I56),0)) - but this doesn't work
Am working on a commission for my staff and I need an IF CONDITION OR VLOOK FORMULA to make it easier for me. This is how I have allotted the commission
Sales Commission
20,000.00 is 50.00
25,0000 is 100.00
30,000.00 is 150.00
35,000.00 is 200.00
40,000.00 is 250.00
Please kindly help me out
HI IM TRIED FROMULA FOR IF TWO COLUMN VALUE IS SAME THEN I WANT PRINT VALUE TO ANOTHER COLUMN
eg:-( if a=b value is same then c value print in e column)
note** i want column value not cell like a2 value in some time is a4 value so can tell me the fromula please find the value of two column and then print value )
Hello,
I have 2 columns..... say A & B
Assume column A1 has some values already, and If I type any other words other than "Approved" in B1 or Column B1 is left empty, then Column A1 should stay in same old value, not even change to FALSE.....
If and only if I type "Approved" in Column B1, then A1 should automatically change to "COMPLETED"
These formula i need to populate throughout the column B
Thanks....
Hi
Can anyone help me on this? I am creating a formula for time and date. If the time exceed at 5:00 PM. The date and time will appear the next day and the time will be 9:00 AM.
Example
8/1/2017 5:00 PM result 8/1/2017 5:00
8/1/2017 5:02 PM result 8/2/2017 9:02
What is formula for this?
Hi, your explanation and example don't quiet marry up, so I will give you 2 solutions.
Info:
9AM is 09:00 ( 9/24)
5PM is 17:00 (17/24)
From 5PM to 9AM is +1 day -8 hours or +16 hours (16/24) (2/3)
#1 After 5PM show Tomorrow 9AM
IF( ( A1-INT(A1)) > (17/24), INT(A1) +1 +(9/24), A1)
#2 After 17:xx show Tomorrow 09:xx
IF( ( A1-INT(A1)) > (17/24), A1 +(2/3), A1)
# This can get really complex if you want ( 09:00-17:00 M-F, NO Change, Otherwise set time to next work day)
Helloo, anyone would like to help me,
how use "if function. in conditional.
this is the situation.
if the employee paid 100 per month and and if he employed for less that 5 years,this would be his computation for separation fee, 100/2=50/yr, otherwise if he emplyod for more than 5 yrs this would be the computation., 100/ yr.
what is the best formula for this one.
Hello!
I have a formula I wanted to write but I am not to sure what to use.
So here is the idea:
On sheet 1 I have A1 with a value and in B1 I want a formula that finds the same data in A1 on Sheet 2 A:A and return the value that is in the matching A:A cell with the value that is in the next cell over (B).
I dont know if that makes sense.
=IF(AND(C9="abc", E9=TRUE), C3, IF(AND(C9="abc", E9=FALSE), D3,""))
Could you please help?
I need a warning when transposing numbers in different columns using IF function. Trying to check bank balance in (A1) with other itemised columns, only one value per row.have tried =IF((B1,C1,D1,E1,)=A1,"OK","NG") Have received #value results at times. Cheers Garry
Hello, Garry. Thank you for contacting us.
If I understand your task correctly, the formula below should work for you:
=IF(OR(B1=A1, OR(C1=A1, OR(D1=A1, OR(E1=A1)))), "OK", "NG")
If the task is different, please describe it in more detail. I'll do my best to help you.
Hi everybody,
Can you please help me work out on this formula:
I have the following table of an employee and I need to add 20 leaves on the
anniversary date of joining of this employee i.e. every year on the 20th of June in his/her credit:
Date of Joining: 20th June 2014 (dd/mm/yyy) 20/06/2014
Duty Period Add 20 Leave Taken
20/06/2015 25/07/2016 20 26/07/2016 30/07/2016
31/07/2016 31/05/2017 0 - -
01/06/2017 15/06/2017 20 16/06/2017 15/07/2017
Column A1&B1 is the Duty period, C1 Add 20 or leave it blank, D1&E1 is the leave taken period. Row 1 shows Duty period and leave taken,Row 2 shows only duty period and since duty period does not fall in the range of anniversary date C1 will shows "0" or blank. In the 3rd row the anniversary date falls in the leave period so 20 is added.
I have searched the whole of Internet but yet to find a solution for the same. A formula for the same will be much appreciated.
Thanks in advance.
John Sanil
i want to know what will be the formula if i want to compute for example:
value for A=P, B=P, and C=P, then it should be S
and vice versa;
and;
value for A=P, B=P, and C=NP, then it should be S
value for A=NP, B=NP, and C=P, then it should be
or: if for the cell a,b,and c have at least more than 1P then it should be P; same with the NP if more than 1 then it should be NS
How to create a IF formula for Cell that contains percentage between 95% - 100% will be stated as "ACTUAL", less then 95% will be stated as "DOUBLE", between 100% - 115% will be stated as "FIFTY PERCENT", above 115% will be stated as "NIL"
Hi Virendra,
Copy the following following formula in B2 (the answer cell):
=(IF(A2>114.9%,"NIL",IF(AND(A2>=100%,A2=95%,A2<=100%),"ACTUAL",IF(A2<95%,"DOUBLE")))))
Format cell A2 as percentage.
The premise:
94.9% and below = DOUBLE
95% to 99.9% = ACTUAL
100% to 99.9% = FIFTY PERCENT
115% and above = NIL
Format cell A2 as percentage.
The only problem with this formula is that if nothing is mentioned in cell A2 the answer always displays "DOUBLE".
Hope Svetlana Cheusheva or someone can improve upon the formula.
Regards,
John Sanil
Dear Virendra
Sorry the premise (100% to 99.9%)
should read as: 100% to 114.9%.
Rest all remain the same.
John
Can someone help with the formula as per below mentioned details
If "C" column Budgeted figure is 40.83 & Actual in "D" column is 37.69 then the VAR in "E" column is -3.15 with 92% Achievement in "F" column and the weightage defined for 100% achievement is 35 Marks which is in "G" column.
I am looking out the IF formula help that if "F" column is less then 79.99% then "0" marks, and if same is between 80% to 94.99% then half of the 100% weightage defined 35 marks that is 17.5, and if the scoring is between 95% to 100% then the Actual % of weightage defined like if 97% achieved then 97% of 35 marks that is 33.95 marks.
Hi,
please, i have strings in a cell "itdr_a0863_tempodisconti-rtg_it_tem_mth_300_bask" and i would just like to get the "bask" word what function will i use or what is the solution. Thanks