Comments on: Excel IF statement with multiple conditions

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 32. Total comments: 4557

  1. Hi ,

    Could you please help me to find formula

    A | B | C | D | E | F | G | H | I | J | K | L | M |
    WARD|Ward|Description|Average|Ward.|Wardwise|Total|RES |RES|COM |COM|INDUSTRY|INDSTRY|
    1 |1 |RES |0.90% |1 |0.80% |3 |0.90%|2 |0.60%|1 | |
    2 |1 |COM |0.60% |2 |0.60% |1 | | | | |0.60% | 1
    3 |4 |RES |1.00% |3 |1.50% |1 | | |1.50%|1 | |
    4 |5 |RES |1.10% |4 |1.00% |1 |1.00%|1 | | | |
    5 |9 |RES |0.30% |5 |1.00% |2 |1.00%|2 | | | |
    6 |2 |INDUSTRY |0.60% |6 | | | | | | | |
    7 |1 |RES |0.90% |7 | | | | | | | |
    8 |9 |COM |0.30% |8 | | | | | | | |
    9 |5 |RES |0.90% |9 |0.30% |2 |0.30%|1 |0.30%|1 | |
    10 |3 |COM |1.50% |10 | | | | | | | |

    column A,B,C,D (data) (i wanted formula formula to sort column A-D in ascending )
    Column F - ward wise average (used formula =IFERROR(AVERAGEIF($B$3:$B$12,(A2),$D$3:$D$12),"") )
    Column H, J, L - used formula - IFERROR(AVERAGEIFS($D$3:$D$12,$B$3:$B$12,A2,$C$3:$C$12,$I$1),"")

    i have used data - sort in coulmn G,I,K,M but i want formula to sort wardwise-RES, wardwise-COM, etc.)

    in Column N - wanted highest average repeated in column D , and total highest average counts repeated in Column O

    Please help me in find the solution ........ plz need help

  2. cell A1 can have value "ok", "nok", or "n/a".
    same cell B1 can have value "ok", "nok", or "n/a".

    How can I in cell C1 return:

    ok if both A1andB1 are ok.
    nok if either is nok.
    ok if A1orB1 is ok and the other is n/a.
    n/a if both are n/a.

    Below formula returns all except n/a.

    =IF(OR(AND(DD3527="ok", DR3527="ok"),AND(DD3527="n/a",DR3527="n/a")), "ok", "nok")

    1. Hello!
      Please try the following formula:

      =IF(OR(A1="nok",B1="nok"),"nok",IF(OR(A1="ok",B1="ok"),"ok",IF(AND(A1="na",B1="na"),"na","")))

      Hope this is what you need.

      1. You are AWESOME!! Thank you!!

  3. Hi - can someone help me write this in a Boolean "IF" statement.

    IF the years of experience is "0" or less than 5 years, the raise is 2%
    IF the years of experience is 5 years and less than 10 years, the raise is 3%
    IF the years of experience is 10 years and less than 14 years, the raise is 4%
    IF the years of experience is 13 years and less than 18 years, the raise is 5%
    IF the years of experience is greater than 17 the raise is "0"

    Tanya

    1. Hello!
      I hope you have studied the recommendations in the tutorial above. It contains answers to your question.
      Your conditions 4 and 5 contradict each other.

  4. I just want to say that i greatly appreciated and was just amazed how you are still consistently and humbly solving questions of people without getting sick of it, even after more than 2 months of the publication date. Kudos to you man!

  5. Hello! I'm trying to get excel to do an IF function but am having trouble with my formula. I want it to be if Field 1, Field 2, or Field 3 are selected then "Soccer". If Field 4, Field 5, or Field 6 are selected then "Baseball". I'm trying to get excel to automatically bring up with fields are soccer or baseball fields. Thanks!

    1. Hi,
      I hope you have studied the recommendations in the tutorial above. It contains answers to your question.
      Your conditions contradict each other. If the values will be written in all 6 cells, what value do you want to get? “Soccer” or “Baseball”?

  6. Hi, what can I do if I want to print a specific data-field(cell already typed in excel) depending upon a value entered by the user?

    For instance, IF(B1="Petrol", (//I wish to print cell D1 adjacent to it))

    1. Hi,
      You can use the formula

      IF(B1=”Petrol”, D1,"")

      I hope you remember that an Excel formula can only change the value of the cell in which it is written.

  7. Hello there!!

    I am trying to analyze data from a google doc survey. The question I am interested in analyzing was a multiple checkbox response with multiple answers. I am wanting to take the data from that cell (that shows multiple text-based answers) and create a formula that pulls out a specific option/text response and then inputs a 0 or 1 if the option/response is present in the initial cell that has the multiple text answers. How would I create this formula?

    Example of what I want:
    Participant # | Response | Option 1 present | Option 2 present | Option 3 present - etc.
    Participant A | Opt 1, Opt 4 | 1 | 0 | 0 |
    Participant B | Opt 1, Opt 2, Opt 3 | 1 | 1 | 1 |
    Participant C | Opt 3, Opt 4, Opt5 | 0 | 0 | 0 |
    Participant D | Opt 2, Opt 3 | 0 | 1 | 1 |

    1. Hi,
      I’m not sure I got you right since the description you provided is not entirely clear. However, it seems to me that the formula below will work for you:

      =IF(ISNUMBER(SEARCH(1,$B$1,1)),"Opt 1 "&C1,"")

  8. I want formulae based on Num of Trainings
    Num of Trainings
    3
    7
    15
    3
    0
    -7
    Days1

    Pls check where am doing mistake - '=IF(f20,f230,f260 Days"))) and help me in correction

  9. Is there any formula for designing timetable for teachers in a school/ college or university?

  10. Hi, I need a formula for my work,
    I work on students results, in remarks I want to show if rank=1 ,"first position" and if percentage < 60, "fail"
    Want to show the both in the same column.
    I know to use rank formula for positioning, and if formula, but I want to merge them both.

  11. Hi,
    Could you help me, i'm trying to write formula to deduct certain value.
    I have a table with certain numbers and i need to leave the same numbers lesser then 2000.
    But numbes:
    greater then 2000 and lesser then 4000 i need to deduct for 10
    greater then 4000 and lesser then 6500 i need deduct for 20
    greater then 6500 and lesser then 9000 deduct for 30
    grater then 9000 deduct for 40.
    Thank you in advance.
    Dragan

    1. Hello!
      I hope you have studied the recommendations in the tutorial above. It contains answers to your question

      =IF(A2>9000,A2-40,IF(A2 > 6500,A2-30,IF(A2 > 4000,A2-20,IF(A2 > 2000,A2-10,A2))))

      1. Hi,
        Sorry but i didn't see them.
        Thank you very much, this resolved my problem.

        Best regards,
        Dragan

  12. Hi!!

    I am writing a formula to determine Pass/Fail. I used an IF .formula which states this =IF(D6>=75%,"P","F").
    It is stating P/F correctly in every instance EXCEPT where the grade matches or is equal to the 75%. In that instance it is reporting and "F" even though 75% or above is passing. I have trying writing the formula 100 different ways and no matter what I try it will not give a "P" to any cell with a grade of 75%. Please Help!!

    1. Hello!
      I have not been able to replicate your problem. You may be calculating the value in cell D6. In this case, the value on the screen may not match the real one. In this case, you need to use the ROUND function.

  13. If 3 out of any 6 cells of a ROW have a value greater than 0, then how to find it In google sheet.

  14. Sir when I use the if condition in this type of example in many time but we can't find the actual right answer for this condition.so how were we do.
    Example: =IF(B2= "MAHARASHTRA"),(A2*4%),(A2*12.5%))

  15. Thanks a lot very helpful website .

  16. Can you use this to include text entry if two various criteria are met? I.e if the date matches, and the client name matches, what stage in the sales process was the deal at?

    1. Hello!
      I’m sorry but your task is not entirely clear to me. For me to be able to help you better, please describe your task in more detail. Please specify what you were trying to find, what formula you used and what problem or error occurred. Give an example of the source data and the expected result.
      It’ll help me understand it better and find a solution for you

  17. Hi I was hoping you could help. I have Today() in cell A1, date in B3, and a formula in cell C3: =$A$1-B3.

    I want to make cell C3 to be BLANK if cell B3 date is blank with no date.

    I want to make cell D3 to be "YES" if C3>14 and "NO" if less. However, if cell C3 is blank, D3 also should be blank

    Have tried in cell C3 =IF(ISBLANK(B3), "", $A$1-B8) and in cell D3 =IF(C3>14, "YES","NO").

    The cell C3 does return blank however, cell D3 does not, the problem is Today() in cell A1 is returning a value which mean the cell is not empty. I checked by using =IF(ISBLANK(K8), "TRUE", "FALSE"), the answer is False.

    Please kindly help

    1. Hello!
      The formula below will do the trick for you:
      C3 ---
      =IF(ISBLANK(B3),"",A1-B3)
      D3 ---
      =IF(ISBLANK(B3),"",IF(A1-B3 > 14,"Yes","No"))

      Hope this is what you need.

  18. Hi there hoping someone can help me im trying put in a formula that looks at the 2 columns before and depending if a=x b=y then = z

    so as an example ive changed the words to colours(as its for work so privacy rules)

    =IF(($H$2=Red), AND($I$2=Yellow), THEN($J$2="Orange"))

    Red and yellow = orange
    but Red and blue = brown

    Please help! :)

    1. Hello!
      I hope you have studied the recommendations in the tutorial above. It contains answers to your question.

      =IF(AND(H2="red",I2="yellow"),"orange","")

  19. Hi Alexander,
    I require your help on below on Excel.

    Delta MOQ To Order per MOQ
    -150 200 200

    Delta MOQ To Order per MOQ
    -300 200 How to use "f" function to auto 2x200=400

    Thanks

    1. Hello!
      Sorry, it's not quite clear what you are trying to achieve. Could you please describe it in more detail? What result do you want to get? Give an example of the source data and the expected result.

  20. Hi I have a data validation list In cell A1 that has 2 options, "completed" and "not completed". In cell B1 I have a conditional formatted data bar that represents 0 to 100%. How do I use the IF function so that by selecting Completed the formatted data bar changes to 100% and likewise "not completed" it changes to 0%. This is for a task assignment tracker.

  21. Evening to you

    I require your help with a certain dilemma. My task is two parted, to compare which month has the most expenses and to display that month in an adjacent cell.

    The first part of the task is rather simple using the MAX and possibly the IF function if needed. The part I struggle with is displaying the month which satisfies the first criteria.

    In order for you to assist me, I must provide you with the full details. I can not do that here as I can not attach any file here. However, on any email address it is a different outcome altogether.

    Regards
    Jack

    1. Hi!
      Describe your task in more detail and send us a small sample workbook with the source data and expected result to support@ablebits.com. Please shorten your tables to 10-20 rows/columns and include the link to your blog comment.
      We'll look into your task and try to help.

  22. HI,

    I am trying to write a formula with 2 conditions to meet a value and if not return a different value.

    I am asking to look up if cell = UK Mainland and if 2nd cell is = Supply and Install return a value of "55", if not return a value "33 or 50 check origin". The formula is not working see below:

    =IF(and(H12="Mainland UK",L12="Supply & Install", "55", "33 or 50 check origin"))

    I am getting error:

    Not trying to type a formula?

    When the first character is an equal (=) or minus (-) sign, excel thinks it's a formula:

    you type = 1+1, cell shows: 2

    to get around this, type an apostrophe ( ' ) first:

    you type '=1+1, cell shows : 1+1

    I have tried this and its not working, does anyone have a solution please.

    Thanks

    Paul

    1. Hello!
      Please try the following formula:

      =IF(AND(H12="Mainland UK",L12="Supply & Install"), "55", "33 or 50 check origin")

      I hope it’ll be helpful.

      1. Thanks Alexander. I tried that and it didn't work for me, getting the same error message as per my original post.

        Any other ideas on how to return the formula using the apostrophe function?

        Thanks Paul

          1. Hi Alexander,

            Its working now, thanks. There was an issue with excel spreadsheet. I closed it and re did the formula and it works.

            Thanks You.

  23. #need help
    I would like to request the help of (if function)
    Annual leave: if the join date over equal 36 months will get 1 if the join date over equal 72 months will get 2, if the join date over or equal 108 months will get 3,
    so what're formulas that can show anwser:

    Join date: 01/January/2018 : 38months will get 1
    01/January/2015 :74months will get 2
    01/January/2012 :74months will get 3

    1. Hello!
      If I got you right, the formula below will help you with your task:

      =INT(DATEDIF(B1,TODAY(),"m")/36)

      You can learn more about DATEDIF function in Excel in this article on our blog.

  24. You work as an Excel specialist in an organization. You want to test the condition that if A1 is greater than 150 and B1 is less than 250 then the function returns 20, otherwise, it should return 0. Which of the following formulas will you apply to test this condition?

  25. Hi,
    Could you help me with this:
    How to allow Data Entry in column B in Excel only if a Dependent column A is Filled with yes (vs no)?

  26. Hi

    How can we use if, and or or for date which is between start date and end date

    I.e. 1/6/2002 is 18 year

    Start date 1/1/2002
    End date 31/1/2002

    And so on for 17 years / 16 years etc...

  27. I have a spreadsheet with 12 columns. I'd like to write a formula that will change column I to "yes" when the value in column F falls below the number in it. How do I write that please?

    1. Hi,
      If a number is written in column I, you cannot change it to "Yes" using an Excel formula. For this you need to use VBA.

  28. I need a formula with multiple conditions.
    If "No" and none of 4 cells are <-49.9%, then "1", if "No" and none of 4 cells are between -49.9% and -24.9%, then "2", if "Yes" and none of 4 cells are <-49.9%, then "3", and if "Yes" and none of the 4 cells are between -49.9% and 24.9%, then"4".

  29. Looking at a formula that has more than 0 digits in a single cell, we have to add the value of a fixed cell.
    LIKE IN C2:C10 C5 ,C8 CELL VALUE IS MORE THEN 0, THEN I HAVE COUNT IN B2:B10 VALUE,
    But the value which has more than 0 digits is the value of cell B2: B10.

  30. Can anyone please help me get this formula right. My conditions are, If A2 value (Percentage value) is lower or higher than B2 value (Percentage value) by 2-5% then C2 should say False.

      1. Thank you, it worked for me

    1. If A2 value = B2 value or if A2 and B2 value difference is just +/-1% then C2 should say Pass

  31. Have three columns and conditional formatting applied across all rows. Conditions for column 1 are >0 is green, between 0 and -20 is yellow, and <-20 is red, similar conditions for columns 2 and 3.

    I'm trying to create a conditional formatting formula that will look at all three instances in a row and if I have a combination of colors for the three columns, output an overall color. 3 greens = green, 3 reds = red, 3 yellows = yellow, 2 greens and a yellow = no formatting, 2 yellows and a red = orange.

    I've tried several different formulas using if(AND( statements, but given greater than two variables, but not always coming out accurate. Any help is appreciated.

  32. Can someone help with this formula. The last part of it doesn't seem to draw in my data.

    =IF($X3='VAL CLASS CATEGORY'!$E$2,VLOOKUP('R&M Detail'!$N3,'Level Lookup'!$A:$F,3,FALSE),IF($Y3='WO PM Desc Lookup'!$J$1,VLOOKUP('R&M Detail'!$AB3,'WO PM Desc Lookup'!$A:$C,3,FALSE),IF($Y3='COST CENTER LOOKUP'!$H$1,VLOOKUP('R&M Detail'!$D3,'COST CENTER LOOKUP'!$A:$C,3,FALSE))))

    1. Hi,
      It is very difficult to understand a formula that contains unique references to your workbook worksheets. Hence, I cannot check its work, sorry.
      Unfortunately, without seeing your data it is difficult to give you any advice. Please provide me with an example of the source data and the expected result.

      1. Yes , will try.

        The formula is trying to categorize each expense based on three variables: "Val Class Category," "WO PM Desc Lookup," and "Cost Center Lookup" number.

        For instance, First part of formula looks up the item based on the Material number (I have list of materials within the "Level Lookup.") if "val Class Category matches" "$X3" (which it has two options).

        =IF($X3='VAL CLASS CATEGORY'!$E$2,VLOOKUP('R&M Detail'!$N3,'Level Lookup'!$A:$F,3,FALSE),

        This applies to all three parts of the formula

        IF($Y3='WO PM Desc Lookup'!$J$1,VLOOKUP('R&M Detail'!$AB3,'WO PM Desc Lookup'!$A:$C,3,FALSE),

        IF($Y3='COST CENTER LOOKUP'!$H$1,VLOOKUP('R&M Detail'!$D3,'COST CENTER LOOKUP'!$A:$C,3,FALSE))))

        - The problem is with the last part of the formula. It no longer categorizes any item based on the cost center even though there is a cost center number that it can categorize it from.
        - My thinking is that either the first part or second part of the formula is overriding the last one.

        Reply

        1. Hi,
          I cannot check the formula that contains unique references to your workbook worksheets.
          However, it seems to me that the formula below will work for you:

          =IF($X3='VAL CLASS CATEGORY'!$E$2,VLOOKUP('R&M Detail'!$N3,'Level Lookup'!$A:$F,3,FALSE),
          IF($Y3='WO PM Desc Lookup'!$J$1,VLOOKUP('R&M Detail'!$AB3,'WO PM Desc Lookup'!$A:$C,3,FALSE),
          IF($Y3='COST CENTER LOOKUP'!$H$1,VLOOKUP('R&M Detail'!$D3,'COST CENTER LOOKUP'!$A:$C,3,FALSE),"")))

          I have already written to you what you need to check the work of your formula.

        2. Nevermind, I figured out the problem.

  33. Can anyone solve this issue to use the below three different arguments in one cell?

    =IF(OR(D8="1450Friday",D8="1450Saturday"), 6.14, 5.12)
    =IF(OR(D8="1000Friday",D8="1000Saturday"), 6.14, 5.12)
    =IF(OR(D8="900Friday",D8="900Saturday"), 6.14, 5.12)

    Thanks

    1. Hi,
      If you wanted to combine all conditions in one formula, then try this:

      =IF(OR(OR(D8="1450Friday",D8="1450Saturday"), OR(D8="1000Friday",D8="1000Saturday"), OR(D8="900Friday",D8="900Saturday")), 6.14, 5.12)

      Hope this is what you need.

  34. I have a spreadsheet which has a list of employee numbers and required proficiencies along the top. I have a formula which puts a Y if the person has that proficiency (based off a data sheet). But I would like to make a formula which tells me if someone is qualified based off their proficiencies held . For example one of the variables:

    If employee has a Y under prof 1, prof 2, prof 3 ect (through to prof 12) and they also hold prof 13 or 14, and hold prof 15 or 16 or 17, and hold prof 18 or 19 or 20, and hold prof 21 or 22 or 23 then they are marked as yes otherwise they are marked as no

    I am using Excel 16 so I can't use IFS formulas

    1. Hello!
      Without seeing your data it is difficult to give you any advice. I recommend using the SUMPRODUCT function as described in this article.
      I hope this will help, otherwise please do not hesitate to contact me anytime.

    2. Further to my last comment, what would be the most efficient formula for marking "Y" if they have the proficiency. I currently use:
      =IF(ISERROR(VLOOKUP($A6&J$5,PROFRPT,1,0)),"","Y")

      On the reporting tab in column A I have the formula =B2&L2 and the name manager PROFRPT:
      ='Proficiency Report'!$A$2:INDEX('Proficiency Report'!$A:$A, COUNTA('Proficiency Report'!$A:$A))

      Although I get really large lag with calculating. To the point where sometimes I can even save and exit the workbook for hours because it's caculating

  35. hi i need to do calculation in multiple cell
    m3=>1 then 1,m3>=2 then 2, m3>=3 then 3 and so on till 9
    pls help

  36. 01,02,03....... these numbers are (month) / 001,002,003......these numbers are (serial number)

    01/001= for this numbers/equation somebody please let me know the formula for this.

    Thank you

  37. I have a number that i want to find if it is available in a table of ranges then give me range index of the number
    ex:
    if i have a number 76 i want a formula to check number 76 in the below table and brings me the index =2
    if i have a number 211 i want a formula to check number 211 in the below table and brings me the index =4
    table of ranges
    1 1 to 69
    2 70 to 138
    3 139 to 207
    4 208 to 276
    5 2277 to 345

  38. Hi,
    Thank for such a great post!! and quick response for other!!

    Can you please help me!!
    My Logics are: 0+0=A, 0+1=B, 1+0=C, 1+1=D.

    I Tried with this, =IF(AND(I2="",J2=""),"A",IF(AND(I2="",J2=""),"B",IF(AND(I2="",J2=""),"C","D")))
    But this shows only A or D !!

    Thanks in advance.

    **Please ignore my previous post.

    1. Hello!
      If I got you right, the formula below will help you with your task:

      =IF(AND(I2="",J2=""),"A",IF(AND(I2="",J2 < > ""),"B",IF(AND(I2 < > "",J2=""),"C","D")))

      I hope it’ll be helpful.

  39. Hello all,
    I have the current formula
    =IF(AND(I32>=$O$32,ABS(J32)= 1 hour and cell J32 <=.125 inches than I get a passing result. I am trying to add another condition onto this formula in that if cell J32<= .002 at any time I would also get a passing result. Any help would be greatly appreciated

    1. Hello!
      If I got you right:

      =IF(AND(I32>=$O$32,ABS(J32)= 1,J32 < = 0.125,J32 < = 0.002),TRUE,FALSE)

      I don’t think this formula will work as the conditions ABS(J32)= 1,J32 < = 0.125,J32 < = 0.002 contradict each other. They cannot be executed at the same time.

      1. Cheers! I did have the incorrect formula written in my first comment. The correct formula is:
        =IF(AND(I32>=$O$32,ABS(J32)<=0.125),"Pass", "Fail")
        From here I was looking to add another condition onto this formula in that if cell J32<= .002 at any time I would also get a passing result. Apologies for the typo in the first question. I will see if I can implement your reply but more help in the matter would be fantastic.

        1. Hi,
          Please try the following formula:

          =IF(OR( J32<= 0.002,AND(I32>=$O$32,ABS(J32)<=0.125)),"Pass", "Fail")

          Hope this is what you need.

  40. Hello everyone,

    Could you please check my formula?

    =IF(F2>=5000 & G2>=10%,"5%",IF(F2>=5000 & G2<10%,"3%",IF(F2<5000 & G2<10%,"10%",IF(F2=10%,"4%"))))

    So what I am trying to do is basically puting 2 conditions for 1 result. I will call the ensemble of these 2 conditions "Super condition", which in this case are 4 "super conditions".

    After including the formula, it gives me only one result, which is 5% no matter how much I change the values in the super condition.

    Can any one support regarding this matter, it would be most helpful!

    With my best regards,

    1. Hello!
      Your formula has the wrong AND condition. See Example 1 above.

      =IF(AND(F2>=5000, G2>=10%),"5%",IF(AND(F2>=5000,G2<10%),"3%",IF(AND(F2<5000,G2<10%),"10%",IF(F2=10%,"4%",""))))

      1. You are a Godsend, thank you very much!

  41. I created the following formula based on the tutorial above. While the formula appears to work, I am unable to sum the results. I wasn't able to fix this by changing the formatting - it's already set to numbers. Any idea why this isn't working?

    =IF(A1>=30, "1.0", IF(A1>=10, ".5", IF(A1= 10-29, result should be .5
    A1>= 30, result should be 1.0

    Once I get the result, I then need to be able to sum the column for all values.

    1. Hello!
      To perform calculations on the results of your formula, it must return a number, not text.

      =IF(A1 > = 30, 1, IF(A1 > = 10, 0.5, IF(A1<10, 0)))

      I hope it’ll be helpful.

    2. I created the following formula based on the tutorial above. While the formula appears to work, I am unable to sum the results. I wasn't able to fix this by changing the formatting - it's already set to numbers. Any idea why this isn't working?

      =IF(A1>=30, "1.0", IF(A1>=10, ".5", IF(A1<10, "0")))

      A1= 30, result should be 1.0

      Once I get the result, I then need to be able to sum the column for all values.

      I tried to submit this once already, but when it posted the details jumbled together - trying again.

  42. =IF(E2>=70, "Excellent", IF(E2>=60, "Good", IF(E2>40, "Satisfactory", "Poor ")))

    This formula doesn't work as is stated. How to make it work if you have logic text and column true and false. For example:
    Logic: E2>=70
    True: "Excellent"
    False: "Poor"

    How to insert other variables to work?

    1. Hi,
      The formula you wrote works. But if I understood correctly, a different formula is needed for your conditions.

      =IF(E2 >= 70,"Excellent","Poor ")

      Hope this is what you need.

  43. Trying to do the following:

    If text in A1:A30 = "Apples" then take number in B1:B30 and divide by 2. below is what i am trying to make it look like. Probably pretty easy for some but i am a rookie

    column A Column B Column C
    Apples 5000 2500

    1. Hi,
      Please use the following formula:

      IF(A1="Apples",B1/2,"")

      After that you can copy this formula down along the column.

  44. I have situation in which. If Requirement is greater than a Packaging standard then it should return value as per PAckaging standard. Ex - if requirement is 19 Kg and Packaging standard is of 6Kg then return value should be 24 KG.

    Another Example - If Requirement is of 17 Kg & Packaging standard is of 4 KG then return value should be 20 KG.

    Plz help me to apply this formula

  45. Can i do a formula for this?
    Tally all the dollar amount in column O lines 2 through 50
    But Only if there is a Y (for yes) in column V on each line
    If there is a N (for no) in column V its not included in the grand total

      1. Thank you for the link. I still cant figure it out. Those all seem to just give me a tally of numbers. I need a sum of the amounts. So in Column O i have 50 lines of salaries. In Column V i have 50 lines of either Y or N ( for yes or no). I want to be able to get the dollar amount total in Column O only if there is a Y in column V. The COUNTIF formula was only giving me the number of Y's i had in column V.
        That way i can see the grand total dollar amount update if i change the Y to an N or vice versa.

          1. THANK YOU!

  46. Good day
    The second cell as my reference cell to my third cell has already formula, the formula is =IFERROR(C14/$C$13,0)*100 and displays nothing. The formula of the third cell is =IF(OR(D14=""),"",IF(D14>83.99,"O",IF(D14>75.99,"VS",IF(D14>67.99,"S",IF(D14>59.99,"FS",IF(D14<=59.99,"DNME","")))))) , but still the DNME will display. I want it to display nothing if the cell has no entry

    Please help me.. Thank you

    1. Hello!
      I assume that you have some non-printable character written in cell D14. Copy the formula onto a new blank worksheet and test it there.

  47. What if i have 2 worksheets ( A and B). Worksheet A has a lot of data with various columns but in column A there are unique codes. Worksheet B has a few items all taken from worksheet A. Worksheet B also has the unique codes in column A (the same codes as worksheet A). i want to do a statement where it shows the following: if the unique code in worksheet B is he same as worksheet A and if column O in worksheet A has a date in it on the same row as the specified unique code then say YES in column H on worksheet B, if it does not have a date in it then say NO.

    1. Hello!
      If I understand your task correctly, the following formula should work for you:

      =IF(IFERROR(DAY(CELL("contents",INDEX(Sheet1!$O$1:$O$30,MATCH(A1,Sheet1!$A$1:$A$30,0)))),0)>0,"Yes","No")

      I hope this will help, otherwise please do not hesitate to contact me anytime.

  48. 2.8
    3.1
    5.0
    5.8
    5.0
    2.0
    2.8
    3.1

    HI SIR HOE CAN I CALCULATE % OF 5.0 DATA IN COLOUM

  49. I am trying to write an excel formula which can be dragged across a row of cells to give the number of days in each month between two specified dates.
    A B C D E F

    1 | START DATE | END DATE | Jan | Feb | Mar | Apr ...etc |Location
    ---------------------------------------------------------
    2 | 01/26/20 | 10/30/20 | 0 | 19 | 15 | 0 |Mexico
    3 | 07/15/20 | 12/03/20 | 0 | 19 | 15 | 0 |United States

    Also, i have location specific holiday list to be excluded in this calculation. Now i am using the below formula to drive the days. But i can't change the holiday list based on Location column. I am expecting the holiday list to be chosen based on the value in the location column.

    =MAX(0,NETWORKDAYS(MAX(D$5,$B6),MIN(DATE(YEAR(D$5),MONTH(D$5)+1,0),$C6),$T$1:$T$20))

    Holiday List seems to be as below.
    United States Mexico
    1/1/2021 7/5/2021
    2/15/2021 9/6/2021
    5/31/2021 11/11/2021

    1. Hello!
      You can use IF function:

      =IF(F5="Mexico",MAX(0,NETWORKDAYS(MAX(D$5,$B6),MIN(DATE(YEAR(D$5),MONTH(D$5)+1,0),$C6),$T$1:$T$20)),MAX(0,NETWORKDAYS(MAX(D$5,$B6),MIN(DATE(YEAR(D$5),MONTH(D$5)+1,0),$C6),$S$1:$S$20)))

      I hope this will help, otherwise please do not hesitate to contact me anytime.

      1. @Alex, thanks for your response. this is really helps. But In my case, i have a holiday list for nearly 20 regions. It's quite complicate to write if condition. Is there alternatives to perform this action?

        1. Hello!
          You can use a named range in your formula.
          Create from $T$1:$T$20 named range "Mexico". Create from $S$1:$S$20 named range "United States".
          Please try the following formula:

          =MAX(0,NETWORKDAYS(MAX(D$5,$B6),MIN(DATE(YEAR(D$5),MONTH(D$5)+1,0),$C6),INDIRECT(F5)))

          If F5 contains "Mexico", then the formula INDIRECT(F5) will substitute the range $T$1:$T$20.
          I hope I answered your question. If something is still unclear, please feel free to ask.

  50. I have a list on a tab called data which has the following:
    Employee ID in cell A2, A3 ect
    Start date in cell B2, B3 ect
    End date in cell C2, C3 ect
    Leave code in cell D2, D3 ect

    Then I have a monthly calander on a tab called calander which has the following:
    Employee ID in cell A3, A4 ect
    The date in cell E2, F2 ect (i.e 1 Feb, 2 Feb)

    I want to insert a formal into the calander tab in say cell E3 which does the following: if the members employee number in A3 appears anywhere on the list on the data tab and the date in E2 falls between the dates on the date tab it returns the leave type for that date range. If that employee doesnt have a leave type in for that date then I want it to return a blank value

    Any help would be appreciated

    Thanks Lauren

    1. Hello!
      If I got you right, the array formula below will help you with your task:

      =IFERROR(INDEX(Sheet2!$D$2:$D$10, MATCH(1, (calander!A3=Sheet2!A2:A10) * (calander!E2>=Sheet2!B2:B10) * (calander!E2<=Sheet2!C2:C10), 0)),"")

      This is an array formula and it needs to be entered via Ctrl + Shift + Enter, not just Enter.
      Here is the article that may be helpful to you: Excel VLOOKUP with multiple conditions
      Hope you’ll find this information helpful.

      1. Thank you so much this solved my issue, I just had to make a few changes (see below) but this has caused an extra problem for me. Because I used $B:$B etc (because my list on the data tab is indefinite i.e. could have 1000 entries or could have more). I now have a really long calculation time. Is there a way to tell the formula to look at any data in those columns without using $B:$B etc?

        =IFERROR(INDEX(Data!$B:$B, MATCH(1, (Calander!$A3=Data!$A:$A) * (Calander!E$2>=Data!$C:$C) * (Calander!E$2<=Data!$D:$D), 0)),"")

          1. Once again you have solved my issue, thank you so much

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)