Multiple Sum If

BenDoc08

Board Regular
Joined
Dec 21, 2008
Messages
59
Hey All

In Column C I have a State, in column G I have a number and in column I I have a cost price. I'm trying to sum cost prices for instances where G and I have specific values. Is there a non VBA way to achieve this?

Thanks in advance,
Ben
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi Ben,

Have a look at the following formula that sums the amounts in I2:I15 where the text in C2:C15 is equal to "NSW" and the the value in G2:G15 is equal to 2:

=SUMPRODUCT(--(C2:C15="NSW"),--(G2:G15=2),--(I2:I15))

HTH

Robert
 
Upvote 0
Trebor76 beat me to it.....but here is an example. If you have 2007 or higher (I think) you can use the function SUMIFS to do the same thing. Just search the help files in Excel for the details. I'm still using an older version that doesn't have this function so I use the SUMPRODUCT function.

Hope this helps.
Book1
CDEFGHIJKL
1StateNumberCostState:MO
2MO205.00Number20
3MO156.00Total20.00
4KS104.00
5KS108.00
6IA154.00
7MO206.00
8KS204.00
9MO209.00
10MO107.00
11KS259.00
12IA208.00
13MO159.00
14NE207.00
15KS202.00
16MO159.00
Sheet1
 
Upvote 0
Trebor76 beat me to it

I'm glad you still posted though as "a picture tells a thousand words" and you added another lead for Ben to follow (if he has 2007 that is).
 
Upvote 0
Thanks for your help guys. It's much appreciated. And thanks gnrboyd for posting a visual too.

I'm happy to say the formula works, though with just one slight problem. It only works for me up to row9999. Once I try and put in row limits over 9999 I get an N/A instead.

I do have Excel 2007 though so will investigate boyd's idea.

Cheers again for your help, it's much appreciated.
 
Upvote 0
Happy to confirm sumifs work.

Using Trebor's initial example this is the formula I used:

=SUMIFS(I:I,C:C,"NSW",G:G,2)

When using the SUMIFS feature you put the sum range first, then the criterias after that, in the syntax of criteria range, criteria.

Thanks agan guys.
 
Upvote 0
There shouldn't be any problem with going past row 9999. Make sure all of your ranges in the formula have the same beginning and ending row. Otherwise, you will get errors. If you still have trouble with it, post the exact formula and someone can take a look.

"a picture tells a thousand words"
I agree. I am visual in nature and examples always help me.
 
Last edited:
Upvote 0
=SUMIFS(I:I,C:C,"NSW",G:G,2)

With the massive number of rows (1,048,576) avaiable in 2007 and beyond, try not to reference entire columns.
 
Upvote 0

Forum statistics

Threads
1,224,567
Messages
6,179,571
Members
452,927
Latest member
whitfieldcraig

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top