Comments on: How to use SUMIF function in Excel with formula examples

If you are faced with a task that requires conditional sum in Excel, the SUMIF function is what you need. It is a really great function that can help you make sense of an incomprehensible set of diverse data. Instead of adding up all numbers in a range, it lets you sum only those values that meet your criteria. Continue reading

Comments page 8. Total comments: 346

  1. Thanks Svetlana. You have really helped a great deal.

    Please, how can i find two cells having same numbers in excel. For example if A1 and B1 with numbers like A1=34 and B1=39. how can i find cells side by side with same value as 34,39. e.g H15=34,I15=39.

    Thanks,
    Jolly.O.A

  2. how to use sumif formula for datewise total for particular party and party's total for particular date in one coloumn

  3. amt 3k if % less than 50%. to calculate total amt x 106%
    amt 3k if % more than 50%. to calculate total amt x 115%
    can advise on the formula?

  4. Can anyone help me I have this 5000 list 1) column1- pan / name of customer
    2)column various transaction types like P/T/S/R (as per the customer transaction details its short)
    3) consists of total amounts and one customer has many transaction.. I used Sumif formula to get their total but I want a specific customer name showing total amount where as only transaction of (P)..
    Please help

  5. i need sumifs total for each person

    A b c d e f
    john 19,018 2,408 1,000 2,000 16,610 145,341
    babu 4,563 578 1,000 2,000 3,985 15
    raju 62,865 7,961 1,000 2,000 54,904 346,323
    john 125,000 15,830 1,000 2,000 109,170 109,170
    babu 63,697 8,066 1,000 2,000 55,631 55,631
    raju 100,000 12,664 1,000 2,000 87,336 87,336
    raju 50,806 6,434 1,000 2,000 44,372 1,352
    raju 100,000 12,664 1,000 2,000 153 87,336
    raju 59,115 7,486 1,000 5,000 132 51,629
    babu 39,098 4,951 1,000 5,000 1,546 34,147
    babu 500,000 63,319 1,000 5,000 15,463 436,681
    babu 25,000 3,166 1,000 5,000 1,566 21,834
    john 181,934 23,040 1,000 13,200 19,761 6,301
    john 154,973 19,625 1,000 16,565 135,348 135,348
    john 25,898 3,280 1,000 45,646 14,564 22,618
    john 150,000 18,996 1,000 54,644 1,564 131,004
    babu 612,971 12,019 1,000 5,465 68,546 600,952
    babu 325,000 1,000 456,468 74,563 325,000

  6. =SUMIF(A2:A10,"",C2:C10) sums values in column C if the corresponding cells in column A are not blank, i.e. they have some content. Therefore it will include values where the cell in A column contains a formula even if its result is "".

    To work around this issue try =SUMIF(A2:A10,"><",C2:C10) instead.

  7. i am using this =SUMIF(A3:A33,"<="&TODAY(),K3:K33) excel formula to calculate MTD whhich will compute sum upto today as i enter data everyday.

    however need help to see how to calculate MTD average percentage !

    [Note: column A being Date 1 to 31 and
    column K being Occupancy%]

  8. Thanks.

    Please can one do nested If over 64 level of nexting?..

    Kindly advise.

    Thanks,
    Jolly.O.A

    1. Hi Jolly,

      To my best knowledge, there is no way to nest more than 64 levels of If in Excel. You can check out the following alternatives to nested IF's. For example, you can use the CONCATENATE function that allows supplying up to 255 arguments in modern Excel versions, which equates to testing 255 different conditions.

      BTW, did you get my email regarding the minus sign? In case it did not reach you for some reason, the problem was in your nested IF formula in cell B5. Because the numbers are enclosed in double quotes, Excel perceives them as text strings, and as the result other formulas referencing B5 yield wrong results. As soon as you remove the quotation marks, both formulas will work fine, and no minus sign will appear in B7.

  9. IF A3 > B2 , SUBTRACT B2 FROM A3, AND IF B2 > A3 ,SUBTRACT A3 FROM B2. WITHOUT GETTING A MINUS(-) SIGN. BOTH CELL A3 AND B2 CONTAINS FORMULAS.

    KINDLY ASSIST.

    1. Hi Jolly,

      Because you are always subtracting a smaller number from a larger number, there should be no minus sign in the result. It makes no difference whether the referenced cells are filled manually or using other formulas. It's difficult to say what is causing the minus sign to appear without seeing your worksheet. If you can send it to me (support@ablebits.com Att: Svetlana), I will try to help.

  10. THANKS FOR THE SWIFT RESPONSE.

    THE PROBLEM NOW IS THAT THE RESULT IS SHOWING A MINUS SIGN. MAYBE BECAUSE I ALREADY HAVE FORMULAS IN BOTH CELL A3 AND B2.HOW DO I CREATE THIS FORMULAR WITH GETTING A (-) SIGN. THANKS

  11. This is exactly what I was looking for, thank you!!

  12. help to make the formula to count total of following.
    1 2 3 4 5 total
    P P P H P ???

    if p=1,than total sum=??

  13. Hello,

    Please help me with the formula/function to be used in order that i can get the total sum of the credit limit of a group of customers as shown below:
    Customer Credit Orders
    Cust#1 100 17
    Cust#2 200 100
    Cust#2 200 50
    Cust#3 300 100
    Cust#3 300 150
    Cust#3 300 50
    -------------------------
    Total 600 467
    =========================

    Thanks a lot!

  14. I am working on an monthly evaluation form for employees. It needs to sum cells and calculate a percentage but only if data is entered in a cell. An example of the basic set-up of the sheet is:

    Professionalism: [Graded on a scale of 1 to 10]
    Positive Attitude
    Ability to relate to peers
    Ability to relate to supers
    Ability to relate to customers
    Communicate orally
    Communicate verbally
    Support other beliefs
    Respect differing opinions

    Every employee would be graded each month and the scores would be averaged to give a percentage, but only if data is entered.

    Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
    5 6 7 60%

  15. Thanks for helping me about the use of IF operator.
    But I want to ask you how to use NOT operator within the AND and OR statement.

  16. I have a Summary sheet full of all of the products which are available. It contains a Total number of products. The products are Booked In on one sheet and are then Booked Out from another, the Summary sheet contains a SUMIF-SUMIF which calculates the total. I require a warning system or conditional formatting to indicate the Min/Max for a total. Not all products have the same Min/Max.

    The problem that I am having is that if I set up conditional formatting for specific cells and a new product is added, it moves the conditional formatting to another cell. In theory is it possible to make sure the conditional formatting sticks with its specific cell/product number? Or is there another method?

  17. Can someone PLEASE help me?

    I am trying to get a some of column A1:A1500 (only numerbic values) however, I have 2 additional conditions - I only want Excel to add the numerbic values in A1:A1500 for Nike's (type of sneakers) and the color Pink (color)

    F:F is where the different types of Sneakers are listed and and column H:H is the various colors. I am trying to create a formula that will add (total sum) of the #'s of sneakers bought per customer (0-17) which is in column A:A - Pink Nike's ONLY?

    Thanks in advance!

  18. Hello,

    I need to use a SUMIF formula I am pretty sure.

    I have one sheet with outstanding invoices on it, and another sheet with a total for each customer as they aid I mark them YES for paid.
    I need to work out what the formula can be so the paid invoices are not included in the total for outstanding.
    Can anyone help?

  19. Hi,

    I want to use special character as >, 1 5
    >1 10
    |K 3
    |K 1

    Summary
    Codes Amount
    >1 15
    |K 4
    I need to use sumifs because i had multiple conditions in my table

    Thank

  20. Hi my homework says "In cell B33, enter a formula to add the individual 5 cells one at a time." how do I go about doing that?

    1. Hi, I just happen to be on the site to see if there was an answer to my question.

      For you, the easiest way is just to click on B33, enter =SUM(B1:B5) into the formula space, click the check mark next to the fx icon.

      If you did it correctly then when you enter the values in cells B1 through B5 then B33 will add those independent values.

  21. First Example:
    A1 (Date); B1 (Bucket Size of 2.5 gallons); C1(Seconds To Fill Bucket); D1 (Gallons Per Minute).

    Quest:
    A1 (Date); B1 (Seconds To Fill Bucket);C1
    Gallons Per Minute

    Hi,
    I’m cyber (computer) un-savvy . . .
    I succeeded with three cells, in that, that equation =SUM(B1/C1*60) imposed in D1 will provide me with a correct answer. . Note, A1 is just the date of occurrence and is NOT necessary for the equation.
    My quest is to formulate the equation so that it only involves two cells. B1 represents the constant (2.5 gallon bucket) that is divided by a variable (time of seconds to fill the bucket) that is entered into the cell, and C1 is the hiddeb equation that displays the answer (gpm). In essence, the equation is 2.5/B1*60=gpm . . . 2.5 is a constant bucket size, B1 is the variable of time (seconds to fill the bucket), *60 is a constant (60 seconds) = ANSWER (gallons per minute)
    I have partial success, in that, C1’s equation =SUM(2.5/A1*60) functions if A1’s value is less or greater than 0 (zero). However, with the aforementioned equation, if the B1 value is 0 (zero) or left empty (implication that a sample was not obtained for that date) then there is an annoying and always present cell admonition of #DIV/0!.
    Can you help???
    Blessings,
    Tim

  22. I have never commented on such a forum before. However, thought you deserved truck loads of positive feedback on a concise, easy to understand, educational post. Thank you.

  23. I wish to set up a criteria in such a way that it adds numbers in a range but the criteria excludes certains conditions within the criteria range.

    Row A B
    1 212200 10
    2 218000 20
    3 214000 40
    4 215000 50
    5 216000 60
    6 217000 80

    I this example I want to add up column b(b1:b6), criteria range (A1:A6), criteria is anything => 212200, but <=217000 and exclude 215000 to 216000.

    Please help...

  24. Hello, I cam trying to create a formula where I have 2 cells - one is the gross weight and the other is the dimensional weight. sometimes it differs on which one is greater. I need to create a sum of multiplying the charge by which ever the weights is greater. Can you please help me?

  25. I am trying to work on a sheet where i have customer sales details of two products from which i want to calculate which customer has purchased what product in total. for one i cn calculate using "sumif" formula but its difficult to change the for formula for each customer.. can you please suggest me

  26. hi
    i have row with the following data in the cells:
    A3=20, B3=50, C3=PAID, D3=60, E3=PAID, F3=60, G3=PAID, H3=20, I3=40, J3=60
    I WANT TO SUM THE FOLLOWING CELLS: A3, C3, E3, F3, J3
    AS A RESULT I GET AN ERROR NAMED "VALUE".
    HOW CAN I SUM THESE CELLS WITHOUT GETTING AN ERROR.
    THANK YOU,
    ZVI

  27. Hi
    I am needing a formula that sums only if both cells have a value.
    And that answer will be multiplied by another cell
    For example =a25+b25*g28
    The formula is put into c28, I don't want anything appearing in c28 until both a25 and b25 contain a number or value, It needs to wait to add until I put a number into both cells,
    Thank you soo much for your time,
    I am useing 2013 excel

  28. Hi

    I'm trying to set up a prepayments schedule and I have the start date, end date, amount and daily rate shown is separate cells for an invoice. I have 12 further columns for each month of the year. I would like to have the invoice amount split between the months according to the number of days relevant to the month. eg an invoice may run from 13th of 1 month to the 12 of another. is there a formula that will calculate the number of days relevant for the month and multiply this by the daily rate?

  29. I am trying to create a formula that puts in a cell an invoice amount based on different date ranges.
    The invoice amount will be $1000 if the invoice date is between 2 date ranges in a month say August (100 %)
    The invoice amount will then drop to 900 if between 2 date ranges in September(90%)
    The invoice amount drops to say $800 if between 2 date ranges in October.

    1. Hello Michael,

      You can use the following kind of formula for your task:
      =IF(AND(A1>DATE(2015,8,1), A1<DATE(2015,8,31)),1000,IF(AND(A1>DATE(2015,9,1), A1<DATE(2015,9,30)),900,IF(AND(A1>DATE(2015,10,1), A1<DATE(2015,10,31)),800, 1000)))

      It allows you to list several conditions for different values that you want to show. Please also see for examples of using dates in your formulas.

  30. I don't think this site is being monitored anymore. I don't see any answers.

    Hello?

    1. Hello Jeannie,

      We apologize for the delay, it takes time to look at all the comments we get and provide a solution. Please find the formula for your task above.

  31. Hello,

    Column A i have date starting from 1 to 30 up to rows 30...

    Column B i have Day from Monday to Saturday up to rows 30...

    Column C i have Traget hours from 16 to 50 hours with if logic function base on value of column F ( Total of column D and E )

    Now i want to apply sumif formula at the end for day for Example if the day is Friday then ...

    =SUMIF(A1:A30,"Friday",B1:B30 )

    But formula not given any error or and doinn sum also..

    But same formula when I apply in column those have direct value ( not coming from if fuction ) it's working properly.

    Thanks if anyone can give anwser

    1. Hello Hari Mohan,

      As you have dates in column A, days in column B, and the hours to sum in column C, your formula should have columns B and C as the range and sum range instead of columns A and B, i.e.:
      =SUMIF(B1:B30,"Friday",C1:C30)

  32. Hello,
    Can you help me regarding sumif formula which not working properly.
    Name of DAy form Sunday to Saturday in Column A and number of working hours in column B ( and column B all values are base on IF formula ).
    When I want to apply SUMIF formula its not working because my target hours base on if formula in column B.

    Same formula when I apply in a simple way then its working properly.

  33. Your help with my problem would be appreciated.
    It is probably a simple code, but I'm struggling with it.

    Every 4 years I have to calculate how many precinct committee people a precinct can have at each site.

    For less than 1,000 voters, it is 1 pair
    For more than 1,001 voters, it is 2 pair
    For more than 2001 voters, it is 3 pair

    The form is a 3 columns: first column is the name of the precinct, 2nd column is the total voters and 3rd column shows how many precinct committee people is allowed.

    Precinct Name Total Reg Voters Allowable Pairs
    Sumter Place Rec Room 3432

    Can you help?

    1. Hello Jeannie,

      I'm really sorry that you had to wait for the formula.

      You can use the IF function with a combination of your conditions for your task:
      =IF(B2<1001,1, IF(B2<2001, 2, 3))

      You need to enter this formula into column C and copy it across the column.
      Here B2 is the cell with the "total reg voters". If there are fewer than 1001, the formula will show 1, if there are fewer than 2001, it will show 2, otherwise it will show 3.

    2. Since I have not heard back on my question, I can only assume
      that there isn't a formula?

      Jeannie

  34. OK. My prior post somehow did not come across what I had written. Trying again

    Create a formula with sumif(s) using >0 or <0 in the equation. Keeps returning either a "false", or sum of entire range.

    sum range = BSJun_Act
    criteria = BSMap_to,"Interco"

    1. Hello Diana,

      It sounds like you need to use the SUMIFS function that lets you specify several conditions. E.g.
      =SUMIFS(B15:B27,A15:A27,"Interco",B15:B27,">0")
      The range A15:A27 is checked for the word "Interco", B15:B27 is checked for the condition ">0".

      You can use named ranges instead of the range references by spelling them this way:
      =SUMIFS(BSJun_Act,BSMap_to,"Interco",BSJun_Act,">0")

      If you get an error, please make sure both ranges are of the same size.

  35. I am trying to create a sumif of sumifs formula using named ranges and using either a >0 or 0",SUMIF(BSMap_to,"Interco",BSJun_Act)0)

    IF(Sumif(BSMap_to,"Interco")>0,SUMIF(BSMap_to,"Interco",BSJun_Act))

    It seems to work if I use an actual range like A15:A27, but I can't seem to find the answer to get this formula to work using named ranges where the range is not in a series.

    Thanks for your help!

  36. Hi, Svetlana,

    I am kind of trying to right down a formula that would count me the following condition:

    - if the certain cells sum (lets say B2 to Q2) would be more or equal to 80, then the sums of the cells B2:B3 should be multiplied by 2 and to it cells B4 and B5 should be added, if the cells sum (B2 to Q2) would be more or equal to 160, then the sums of the cells B2:B3 should be multiplied by 3 and to it cells B4 and B5 should be added, if neither are correct (that is the value of the cells sum is less than 80) then the formula should return value D5.

    Even better formula would be:

    - when the sum of the cells reaches number 80, then the sum of the cells B2:B3 should be multiplies by 2 and to it cells B4 and B5 added, when reaches 160 - multiplied by 3 and to it cells B4 and B5 added. If the sum is less then 80, then the value should be D5.

    I can't get correct formula anyhow...

    Would really appreciate Your insights on this one. Thanks in advance.

    1. Hello Justin,

      You can use the following formula for your task:
      =IF(SUM(B2:Q2)>160,SUM($B$2:$B$3)*3+SUM($B$4:$B$5),IF(SUM(B2:Q2)>80,SUM($B$2:$B$3)*2+SUM($B$4:$B$5),D5))

      If you'd like the summed ranges to shift as you copy the formula, please make the references relative, i.e.:
      =IF(SUM(B2:Q2)>160,SUM(B2:B3)*3+SUM(B4:B5),IF(SUM(B2:Q2)>80,SUM(B2:B3)*2+SUM(B4:B5),D5))

  37. How to sort data when cell are merged and wraped

    1. Hello,
      You can sort merged cells only if they are of the same size: select them and click the Sort icon.
      Otherwise you need to unmerge all cells in the range before sorting.

  38. Hi?

    Kindly help i have data of overheads with diferent dates now i want to sum up using the sum if functions overheads per month eg

    Electricity 2/04/2015 $200
    electricity 3/04/2015 $215
    courier cost 2/04/2015 $2

    Basically i want to come up with a spreadsheet that can be able to sum up overheads say march electricity was eg $700 travel Expenses may $600

    Thanks in advance

    Bismark

    1. Hello Bismark,

      If you want to consider just the month, you can use one of the following formulas to calculate the expenses, e.g. in March:

      =SUMIF(B1:B3,">="&DATE(2015,3,1),C1:C3)-SUMIF(B1:B3,">="&DATE(2015,3,31),C1:C3)

      =SUMIF(B1:B3,">=03/01/2015",C1:C3)-SUMIF(B9:B14,">=03/31/2015",C1:C3)

      =SUMIFS(C1:C3,B1:B3,">=03/01/2015",B1:B3,"<=03/31/2015")

      If you want to consider the value in column A as well, e.g. "electricity", please use the SUMIFS function:
      =SUMIFS(C1:C6,B1:B6,">=03/01/2015",B1:B6,"<=03/31/2015",A1:A6,"electricity")

  39. i just want to sum all in one merge cell only
    Thanks You;

  40. 1 Vikash 50 ?
    50
    50
    50
    2 Mahesh 100 ?
    100
    100
    100
    3 Rakesh 500 ?
    500
    500
    I want to sum these values where is the question Mark (?) in excel with single formula.Please help me.

  41. I have an Excel 2010 worksheet containing a separate "$ amount" column for each of 3 entities (column headers: MD, MDM & MDW).
    The data is rows of direct debit amounts from the company's bank accounts that are specified in 3 "Frequency"-header columns ("MTHLY", "QTRLY" or "ANNUALLY").
    I have auto-summed each entity column, so have an overall direct debit total for each of the 3 entities (MD, MDM & MDW).
    However, I need to auto-calculate the total - OF ALL 3 ENTITIES TOGETHER - for each of the 3 frequency columns (so $ amount total for "monthly", "quarterly" & "annual" direct debits)
    I have wasted the last couple of hours trying to find a formula for this & have tried a variety of SUMIF cell combinations/formulas, but cannot get this to work!!!!
    Can you please advise?

  42. Hi,

    I have a spreadsheet where I am trying to work out a formula to tell me how many cells have a date that is older than a year from today. At the bottom of the training date column I'd like to see a figure that tells me how many of the cells have a date older than one year.
    Are you able to help please?

    Training Date

    01/06/2014
    03/06/2015
    01/01/2014
    01/10/2014
    05/06/2014
    09/08/2014
    01/03/2014

    1. Hi Rae,

      You can use the DATEDIF function to calculate the number of complete years between the dates in, say, column A and TODAY(). And then add up those that are equal to or greater than 1:
      =SUMPRODUCT((DATEDIF(A2:A100, TODAY(),"y")>=1)*1)

  43. I'm not sure if I have the right topic, but I'm trying to subtract the larger number from 2 cells (not a range, eg. A1 and A3) and subtract them from a number in cell A5. I just can't seem to find a formula that works.

    1. Hi Sean,

      Here you go:
      =IF(A1>A3, A5-A1, IF(A3>A1, A5-A3, ""))

      Just notice that the formula will return an empty string if A1=A3.

      1. Thank you so much!

  44. How would I get the sum formula to sum two numbers. I need the smallest number out of Coulum O through R and need that to be added with the number from column S. I just need the sum formula to decipher the smallest number from the range of colums.

    1. Hi beth,

      You can use a formula similar to this:
      =MIN(O2:R10)+MIN(S2:S10)

  45. I am wanting to sum cumulative values across cells if the last cell in each formula is greater than 0.

    e.g sumif(C18:F18,F18>0)
    F18 being the last cell in the formula, and the next one would be (C18:G18,G18>0) and so on

    This is for an actuals vs forecasted spend graph of invoices.

    1. Hi Sarah,

      I believe you can use this one:
      =if(F18>0, SUM($C$18:F18), "")

      1. That works perfectly, thank you! :)

  46. I am trying to sum numbers that occur at specific times (4/20/15 2:01 PM, 2658
    4/20/15 2:04 PM, 2268, etc.)
    but I only want to sum them if they occur during another time window specific in a third column. Is there a way to do this? The goal is to try to take random time periods and make them more uniform (15 minute intervals) by summing results during the random time period.

    1. Hi Rebecca,

      You can try using the COUNTIFS formula similar to this:

      =COUNTIFS(A1:A11, "04/20/2015 2:01:00 PM", B1:B11, 10)

      Where column A contains times, B - intervals, and 10 is the time interval you want to count.

  47. I want to find the sum of the QUANTITY of any row that has a particular text string present in 1 or more columns of that row.

    Example:

    Row 1 has a quantity of 1,000 and has the word:
    "Apple" in 2 of the 5 criteria columns
    "Plum" in 1 of the 5 criteria columns

    Row 2 has a quantity of 2,000 and has the word:
    "Apple" in 1 of the 5 criteria columns
    "Plum" in 0 of the 5 criteria columns

    The resulting quantity for "Apple" would be 1,000 + 2,000 because both Rows 1 and 2 have the word "Apple" in at least one of the 5 criteria columns.

    The resulting quantity for "Plum" would be 2,000 because only Row 2 has the word "Plum" in any of the 5 criteria columns.

    1. Hi Dianne,

      You can add up 5 SUMIF functions, like this:

      =SUMIF(B2:B100, "apple", A2:A100) + SUMIF(C2:C100, "apple", A2:A100) + SUMIF(D2:D100, "apple", A2:A100) + etc.

  48. Hi,

    Reg SUMIFS formula.

    My criteria range include numbers but they are in text format. Such as 00001,00002. Since these numbers are coming from ERP system report, format changing is quite difficult. Please let me know a solution for this. Sum range is OK. My formula is not working because criteria range is in text format. please help.

    1. Hi Rasika,

      Did you try enclosing those text-numbers in double quotes like usual text values? E.g.:

      =SUMIF(range, "00001", sum_range)

  49. I am trying to match amounts from two different datasets. I have cell A1(GL acct #) B1(trial balance $ amt) and then from an entirely different system with the exact same format A1(GL acct #) B1(trial balance $ amt). These GL accts are mapped to one another, the issue with my sumif is that it will pull the return the same $ for multiple lines. This is because in some cases 4 different GL accts from system 1 map into only 1 GL acct from system two.

    I want my sumif to only return the amount ONCE, as opposed to every time it comes across a match. A nested sumif is my thought, saying something like IF((___ has not yet appeared)then(sumif(yadayadayada))else(return(n/a)) but i cant figure it out.

  50. I have a column of a range of dollars and another column with a range of hours.
    I want to have a function whereby if the dollars fall between two values then it returns of a sum of the corresponding hours.

    I.E if the $ are equal to or between $3000 and $5000 then add the hours in the Hours column which correspond to the dollar rows.

    I am sure this can be done - but how?

    Best wishes

    RJ

    1. Hello Rupert,

      You can use the SUMIFS function to sum values in the column with hours when the dollar values fall between two numbers:
      =SUMIFS(B12:B20,A12:A20,">3000",A12:A20,"<5000")

      Here column B is the one with hours and column A contains the range of dollars.

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 :)