SUMIF Range Query

WeeJudz

New Member
Joined
Nov 7, 2015
Messages
13
Hi,

I'm looking to carry out a SUMIF Function, however I don't want to use the regular sum_range - I want to add certain individual cells instead. This seems simple but I've not had any joy - it's along the lines of below. I'm using Excel 2007.

=SUMIF(A4:A11,"H",B4+B7+B8+B10) however this sum 'range' part does not work.

Thanks in advance,

Judith
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hi, you're always going to have problems if your Sum range is not of a similar size to your criteria range.

What's wrong with doing
=sumif(a4:a11,"H",b4:b11) ?

Or maybe even
=sumif(a4:a11,"H",b4:b11)-b5-b6-b9-b11 ?
 
Upvote 0
Hi, sorry should have noted this - reason I can't use the range is because it's specific totals (cells) I want to sum. If I use the range (B4:B10) it'll also add the data as well as totals, some or which is not required. It's purely the totals so has to be specific cells.
 
Last edited:
Upvote 0
One more try ...:
=IF(A4:A11="H",B4+B7+B8+B10,"")

Alternative:
=IF(AND(A4="H",A5="H",A6="H",A7="H",A8="H",A9="H",A10="H",A11="H"),B4+B7+B8+B10,"empty")
 
Last edited:
Upvote 0
Great, I'll try this at work tomorrow.

Alternatively, the other way would be to count the data instead of totals. It'd be a COUNTIFS, first criteria the "H" in column A, and second would be the criteria in the data column B. Is there an easier way to count numerous criteria in a COUNTIFS function (ie =COUNTIFS(A4:A11,"H",B4:11,"O"+"A"+"DS"+"NS") ?
 
Upvote 0
Ok,
Sorry, it's Thanksgiving Day ...
CU tomorrow.

Note:
In the first formula a single "H" is sufficient.
In the second formula "H" must be everywhere.
 
Upvote 0
Hi,

I guess you want only few of cells in sum range, if yes then

Try using =SUMIF(A4:A11,"H",B4,B7,B8,B10) instead =SUMIF(A4:A11,"H",B4+B7+B8+B10)
 
Upvote 0
For the problem from Post #1, try:

=SUMIF(A4:A11,"H",INDIRECT({"B4","B7","B8","B10"}))

For the problem from Post #6, try:

=SUM(COUNTIFS(A4:A11,"H",B4:B11,{"O","A","DS","NS"}))
 
Upvote 0

Forum statistics

Threads
1,214,548
Messages
6,120,146
Members
448,948
Latest member
spamiki

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