Using Aggregate and Index Functions

francoiscj1

New Member
Joined
Aug 21, 2017
Messages
22
I have an office inventory spreadsheet and the following is what I would like to do:


  • Get a running total for quantity even if I sort any column the running total should not break
  • Get Running total sorted by item and should reset when the item name changes
  • Get running total (for visible rows only) when the table is filtered
I know I can do this using aggregate and index but I can't find a formula online that would work to help me. .



 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
[1]
=SUBTOTAL(9,QuantityRange)

[2]
=SUMPRODUCT(SUBTOTAL(9,OFFSET(SumRange,ROW(SumRange)-ROW(INDEX(SumRange,1,1)),0,1)),--(ItemRange=Item))
 
Upvote 0
Thanks for answering Aladin, but I don't understand the answers you gave. Are you giving me two options for my question?
 
Upvote 0
Thanks for answering Aladin, but I don't understand the answers you gave. Are you giving me two options for my question?


"Get running total (for visible rows only) when the table is filtered"

"Get a running total for quantity even if I sort any column the running total should not break"

=SUBTOTAL(9,QuantityRange)

"Get Running total sorted by item and should reset when the item name changes"

=SUMPRODUCT(SUBTOTAL(9,OFFSET(SumRange,ROW(SumRange)-ROW(INDEX(SumRange,1,1)),0,1)),--(ItemRange=Item))

The last one needs a arnge to sum (hence SumRange).

If these are not what you are looking for, please elaborate.
 
Upvote 0

Forum statistics

Threads
1,215,217
Messages
6,123,670
Members
449,115
Latest member
punka6

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