As the name suggests, the SUMIF formula in Excel sums values in a range on a given condition.
Generic Excel SUMIF Formula:
Let's jump into an example. But theory…, Ah! We will cover it later.
For this example I have prepared this data.
Based on this data we need to answer these questions:
Let's start with the first question.
We need to tell the sum of the price won by Ravi.
So our condition range will be name range and that is A2:A10.
Our condition is Ravi and
Sum range is E2:E10.
So in cell I2 we will write:
Note that ravi is in double quotes. Text conditions are always written in double quotes. This is not the case with numbers.
Note that ravi is written in all smalls. Since SUMIF is not case sensitive, hence it doesn’t matter.
The above SUMIF formula will return 31907 as shown in the image below.
For the second question, our condition range will be D2:D10.
Condition is >70 and
The sum range is same as before.
The above SUMIF formula will return 103973 as shown in the image below.
In the third question, our condition is Delhi. But we don’t have a city column. Hmmm… So what do we have? Aha! City code. This will work.
We know that all Delhi city codes start from 1100. City codes are in 6 digits. So we know it is 1100??. “?” operator is used when we know number of characters but don’t know the character. As here we know that there are two more numbers after 1100. They can be anything, so we used “?”. If didn’t know the number of characters, we would use “*”.
Remember wild card operators only work with text values. Hence you need to convert city code into text.
You can concatenate numbers with “” to make them text value.
Now in cell I2 write this formula
This will return the sum of the price whose city code starts with 1100. In our example it is 79836.
Question: I have Sales data that contains Month, Region & Sales in value. Now, what I want in Excel is to calculate the following:
Following is the snapshot of data:
Note: This is an array formula. Use CTRL + SHIFT + ENTER keys together
Sooo… Was this helpful? Let me know in the comments section. Ask for your personalised SUMIF query if you are still facing difficulties.
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.