SUMIFS and ranges Puzzler

ptf205

New Member
Joined
Mar 25, 2013
Messages
7
Excel2013/Win7. This has been driving me crazy all afternoon.:ROFLMAO: It boils down to this:

- I want to add the values in a row (K24:AT24 is the sum range), whenever the corresponding cell in the range (K36:AT36 criteria range) is less than the corresponding cell in the range (K48:AT48 criteria).

I.e., if K36<K48 then K24 is included in SUM, if L36<L48 then L24 is included, and so on...

*Formula =SUMIFS($K$24:$AT$24,$K$36:$AT$36,"<"&$K$48:$AT$48)

The thing that has me most puzzled is that it actually gives me different results depending on in which column the formula is located (and it's the exact same formula, it's not that the cell reference are changing or anything).

When the formula is in a cell in column L for example the result is 2,764, when the formula is in column U it gives me 3,493. The 2,764 result seems to be adding up through the first six columns in the range and stopping (K24:R24) instead of going through the full K24:AT24 range. When the formula is located in a column further out in the sheet however, it will correctly sum all the values in the range that meet the criteria.

What is going on here?!!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Sorry part looks to have been cut off...

"I.e., if K36<K48 then K24 is included in SUM, if L36<L48 then L24 is included, and so on...

*Formula =SUMIFS($K$24:$AT$24,$K$36:$AT$36,"<"&$K$48:$AT$48)
 
Upvote 0
thanks, but this is actually part of a larger formula that has a few other criteria in addition to the one above (I removed the rest of the criteria to try and "debug" and narrowed it down to the one problem). So I don't think (correct me if I'm wrong) that sumproduct can handle all the additional criteria, including some that are not of the same dimensions as sum range.
 
Upvote 0
Thanks Andrew, that does work for the above...but this is actually part of a larger formula that has a few other criteria in addition to the one above (I removed the rest of the criteria to try and "debug" and narrowed it down to the one problem). So I don't think (correct me if I'm wrong) that sumproduct can handle all the additional criteria, including some that are not of the same dimensions as sum range.
 
Upvote 0
" including some that are not of the same dimensions as sum range" nor can countifs but countifs wont work on comparing ranges
 
Upvote 0
Here's the full formula if it helps - the other criteria are working fine, but just the one above is not ...

=SUMIFS($K24:$AT24,$K11:$AT11,"<"&M$55,$K11:$AT11,">"&L$55,$K36:$AT36,"<"&$K48:$AT48)

Thanks again
 
Upvote 0
Thanks, So you're saying that SUMIFS won't work comparing two ranges to each other? I was thinking that Excel would compare the relative positions of the cells, but if that's not the case I wonder why it's working whenever the formula is place in a cell that's further out in the spreadsheet.
 
Upvote 0
Your SUMIFS formula will compare each cell in K36:AT36 with each cell in K48:AT48, but will only return the result of one comparison. Use the Evaluate Formula tool to see what's happening. For SUMPRODUCT:

=SUMPRODUCT(--($K11:$AT11 < M$55),--($K11:$AT11>L$55),--($K$36:$AT$36 < $K$48:$AT$48),$K$24:$AT$24)
 
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,113,998
Members
448,539
Latest member
alex78

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