Google Sheets has two functions to add up numbers based on conditions: SUMIF and SUMIFS. The former evaluates just one condition while the latter can test multiple conditions at a time. In this tutorial, we will focus solely on the SUMIF function. Continue reading
Comments page 3. Total comments: 137
This is my SUMIF formular - =SUMIF(A2:A27,A35,I3:I27)
I get a formular Parse Error. the ranges are only highlighted in colours if I put a space between the range and the Criterion. However, even with the space and the ranges highlighted in their colours I get the same error. Any ideas?
Thanks
Dave
Hello David,
Your formula works correctly on my end. If you're still getting issues, please make sure you're formatting your formula as your locale requires (e.g. it may need a semicolon instead of a comma, just pay attention to formula suggestions). If it still doesn't work, consider sharing an editable copy of your spreadsheet with us (support@apps4gs.com). When sharing, make sure the option 'Notify people' is checked.
Note. We keep that Google account for file sharing only and don't monitor its Inbox. Please do not email there. Once you share the file, just confirm by replying here.
I'll look into it and try to help.
I am trying to calculate a numerical figure to a cell based off of 4 different values.
Essentially, i need
if x = full, y= 5000 or if x = 3/4 full, y =3750
Should be pretty easy. Just keep getting error.
Hello Tommy,
It looks like you need to use the IF function for the task. We explained how it works and how to build formulas with it in this article.
Hi! Thanks for all the useful bits. I'm still stuck trying to get a correct formula for SUMIF. I'm pulling data from another sheet and want to sum for a specific range of dates (one month). So far I have =SUMIFS(MYERS!$C:$C, "'MYERS!'C:C">="DATE( 2019,09,01) , 'MYERS!'C:C"<="DATE( 2019,09,30)", MYERS!Q:Q)
BTW, MYERS! is the name of the sheet I am trying to pull from. The C column has the dates that I'm looking for and the Q column is what I'm trying to add.
Hi, Sarah,
If I understand your task correctly, this should help:
=SUMIFS(MYERS!$C:$C,MYERS!$Q:$Q,">="&DATE(2019,9,1),MYERS!$Q:$Q,"<="&DATE(2019,9,31))
>0.61<0.9
How to use this condition Sumif formula
Hello Anish,
To take into account both these conditions, you need to use SUMIFS. You will find the info on the function in this article.
Hi,
I'm using Color as criterion in the formula but it doesn't work. Am I doing something wrong?
Thanks for your help.
Andrea
Hi Andrea,
it's impossible to sum by color using standard Google Sheets tools. We have a special add-on for this purposes though, feel free to test it out:
https://www.ablebits.com/docs/google-sheets-count-sum-colors/
I'm trying to use this but it requires a data on the cell. I am constantly updating the spread sheet so some of it are blanks yet
Hello Adrian,
The add-on has different functions that count different cells. For example, SUM, COUNT, COUNTA require cells with data, while COUNTBLANK processes empty cells. You'll see more info on the add-on help page:
https://www.ablebits.com/docs/google-sheets-count-sum-colors/#adjust-options
If you need any assistance with our tool, please email us to support@ablebits.com and describe your task in detail. Any screenshots of your data will also help a lot. We'll do our best to help.
Kindly check this link . It's a wrong calculation.
https://cdn.ablebits.com/_img-blog/sumif-google/google-sheets-sumif-dates.png
Hello!
The calculation is correct. Only two dates (C5 and C6) are less than the date in B1. The sum of numbers in column B in the same rows is 700.
I am trying to sum a range of cells that are in the same sheet but on a different tab. They need to meet the criteria of a specific accounting code and then add then sum the amount from another cell if they meet the criteria. The formula I am using says I have a Formula parse error. Can you tell what I am doing wrong?
=SUMIF(‘JULY 2019’!B2:B17,"=6230-30",’JULY 2019’!A2:A17)
Hello Carrie,
your formula contains curly single quotes in sheet references. Try replacing them with straight ones:
=SUMIF('JULY 2019'!B2:B17,"=6230-30",'JULY 2019'!A2:A17)
Is there a way to summarize all the cells in the found rows after executing a filter? Seems like there should be a way to do that. Is there something like a "found set" that can be used were you need to specify a range?
Jim,
no, Google Sheets will add up all cells, filtered as well.
I should say that the SUMIF function works like the filter itself. If you specify what conditions you use to filter your data, we'll be able to suggest the correct formula.
hello, I am trying to use a sumif where I am referencing a different sheet, within the formula the sum range is B:W (a square of a range) and the text turns a color indicating that it is a correct formula but will only return 0. The range to sum does contain blanks, is this the problem? When I choose the range containing the numbers for that specific criterion it does sum the numbers. thanks
Hello Phillip,
Can you please specify the exact formula you use in your spreadsheet?
Hello,
I am attempting to use SUMIF in the following way:
Sheet1 has 488 rows of numerical data, with header data in the first row. I am trying to create a summary on Sheet2. I want to list each Column Header from Sheet1 with the sum of the values in that Column.
On Sheet2, I have copied over the Column Headers into Column A, and want to include their Cell Reference for my criteria.
Here is what I have tried:
=SUMIF('Sheet1'!$G$1:$S$488,$A10,'Sheet1'!$G$1:$S$488)
Where $A10 is the cell containing the first Column Header I want to look up.
Even though my SUMRANGE is the same size as RANGE, it is still only returning the sum value for the 2nd row of data on Sheet1 (directly below the header row).
Am I on the right track or do I need to use a different function?
Many thanks for any assistance!
Hello Meg,
Thank you for your question.
Your task looks interesting but it's quite difficult for me to reproduce exactly what you got. Could you please share a sample spreadsheet with us (support@4-bits.com)? You can replace some important info with irrelevant data and shorten the table if you'd like.
Once you share the table, please confirm by replying here.
Thank you.
I tried using what you wrote in the "SUMIF formulas with wildcard characters (partial match)" section and I keep getting 0.
The formula works just fine with actual characters, but once I swap any of them with the "?" wildcard it always returns 0.
My bad, I didn't know I have to use date(yyyy,mm,dd) if working with dates.
It does seem to be the case that wildcards don't work within that formula though.
Hello Yair,
Would you mind sharing your formula with us? Perhaps, we'll notice right away if anything is incorrect there.
Hi Svetlana,
Thank you very much for writing and sharing such an excellent guide to using SUMIF in Google Sheets. It greatly improved my ability to analyze my data. After a good bit of searching, it was the only tutorial I found that provided the knowledge I needed in a manner that not only showed me how to write the formulas but enabled me to fully understand the concepts behind the formula. Of-course I stopped looking once I found yours, but I have a hard time imagining there is a better one out there.
I really liked how you structured this tutorial. It was a perfect mix of concepts and examples. The progression from simple to more complex cases made it possible for me to understand and implement the more complex scenarios. Well done!
I'm looking forward to your tutorial on SUMIFS!
Hi Michael,
Thank you so much for your kind words! It's always a joy to know that my work is helping others.
We have already posted the SUMIFS tutorial and you can find it here:
SUMIFS in Google Sheets to sum cells with multiple criteria
You nailed it, answered my question quickly, thanks!
Can you add a note that when testing for equality, you don't need to specify a comparison operator?
I'm trying to use this formula to put a value in a cell on a tab called 'overview' that calculates the sum of entries in column c of a tab called 'visit reports' that contain the word school in column b of the 'visit reports' tab. =SUMIF ('Visit reports'!B1:B300, "*school*",C1:C300). It is returning zero even when I have values in both column b and c. The sheet is at https://docs.google.com/spreadsheets/d/1PQFS5_fkhGGfR_2TcAudT9KKE98s8oq0L8zlcES3mNo/edit?usp=sharing. Can anyone help?
Hi.. were you able to figure out how to solve this? Can't get access into the sheet..
Hi Abear,
If you describe your task for me and specify the formula you're trying to use, I'll do my best to help you out.
Wondering if you need to put the sheet name with the sum range too.
Looks like you managed to figure it out though.
Hi!
I would like to know if there are some optimisations about SUMIF.
I mean, is the order of criteria important for the SUMIF? (stop the check when a criterion is false) For the very massive sheets, could be interesting.
Thank you.
This is useful...However, I am looking to create a sheet that has buyer numbers and the costs of what they bought in it. So I will sort by buyer number and then want to sum what they owe. How do I use the SUMIF when I don't know what the criteria is (if buyer #2 bought 3 items, I want to sum those three columns; then if buyer # 3 bought 6 items, I want it to sum those 6 columns) I don't know how many items they will have bought. I hope that makes sense.... thanks!
Hi,
Indeed, helpful. Thank you. But i would like you to help me to use sumifs between two or more sheets. Thanks.
How to do reference from a different sheet itself?
Thank you for your question, Aneesh.
To reference a cell/range from another sheet, first enter the required sheet name wrapped in single quotes, then put an exclamation mark (!), and then enter the range you refer to, for example:
=SUMIF('Sheet2'!B15:B26,">20")
thanks a lot for these great tips!
Thanks a lot! this is very useful
Very thorough tutorial. Love it! I've been trying to get a simple SUMIF to work and have it reference columns on another tab but Sheets does not seem to like this. Have you been able to get it to work?
Thanks!
ex.
Tab to be referenced in the same sheet is called "Joint Chequing".
=SUMIF('Joint Chequing'!C2:C1001, A1, 'Joint Chequing'!D2:D1001)
Please notice that I would like to have more of Excel Tutorial in lesson, because what I'm during now is very helpful to me
I'm learning an lot from theses lesson that I bring up off your system. I appreciate Excel and the lesson's that are giving to me when I'm uploading theses tutorial