Dynamic range, SUMIFS, and blank spaces

arows

New Member
Joined
Feb 12, 2015
Messages
1
Hi,

I have a list of names in one column, and how much they spent on the second. On the side I am using this formula to calculate how much each person has spent:
"=SUMIFS(Spent,Name,L7,Spent,">0")" where Spent is the dynamic range of the names column, spent the dynamic range for how much they spent, L7 the cell containing the name, and if they spent more than 0.

If I add names+amount spent, everything works fine and it calculates the new total. However, if I leave a few cells blank and then input the same thing (name, $), it won't count it. I don't get an error at all, it just doesn't count it.

Any idea on how to solve this?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Would guess your Dynamic Range is wrong, for example is Names are in column L and starts at L3 then use the following as your "Name" Named Range:

=OFFSET(Sheet1!$L$3,0,0,SUMPRODUCT(MAX((Sheet1!$L:$L<>"")*(ROW(Sheet1!$L:$L))))-2,1)

Then do same for Spent (changing column letter to spent column ref).
 
Upvote 0
=OFFSET(Sheet1!$L$3,0,0,SUMPRODUCT(MAX((Sheet1!$L:$L<>"")*(ROW(Sheet1!$L:$L))))-2,1)

This construction will have to calculate over more than a million cells, by virtue of it using entire column references. What's more, OFFSET is fully volatile.

Preferable is either to use an upper bound on the range references, e.g. 1000, or, even better, either:

=Sheet1!$L$3:INDEX(Sheet1!$L:$L,MATCH(REPT("z",255),Sheet1!$L:$L))

if column L contains text values only;

=Sheet1!$L$3:INDEX(Sheet1!$L:$L,MATCH(9.99999999999999E+307,Sheet1!$L:$L))

if column L contains numerical values only, and:

=Sheet1!$L$3:INDEX(Sheet1!$L:$L,MAX(MATCH(9.99999999999999E+307,Sheet1!$L:$L),MATCH(REPT("z",255),Sheet1!$L:$L)))

if it can contain both datatypes.

This construction with INDEX is only partially volatile. What's more, this set-up is not necessarily forced to calculate over all one million-plus rows, and so will be much less heavy in terms of resource required.

Regards
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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