How to keep ongoing tally of visible cells

honkin

Active Member
Joined
Mar 20, 2012
Messages
374
Office Version
  1. 2016
Platform
  1. MacOS
I have a sheet with around 172,000 rows and I need to keep a running total of profit. That part of it is normally no issue, but the sheet itself is to be used to develop profitable systems, so there will be quite a lot of filtering. When filtered, that running total of P&L gets broken.

Here it is working correctly in CG

Jumps Racing.xlsb
CGCHCICJ
2Total P&LPeak P&LDrawdownDrawdown %
3131.32
431.32
5-68.68
6-168.68
7-268.68
8-368.68
Sheet1
Cell Formulas
RangeFormula
CG3CG3=AD3
CG4:CG8CG4=CG3+AD4


So the above works fine with the standard running total calculation; In CG3 the formula is =AD3, then in CG4, it is =CG3+AD4 and so on down the column. When filtering, though, none of these formulas change, so any ongoing P&L will be inaccurate as you can see below

Jumps Racing.xlsb
CGCHCICJ
1WIN
2Total P&LPeak P&LDrawdownDrawdown %
3131.32
7-268.68
8-368.68
Sheet1
Cell Formulas
RangeFormula
CG3CG3=AD3
CG7:CG8CG7=CG6+AD7


Individual profit per selection is in column AD and the running total will be in CG. So how is it possible for the first visible cell in CG to always equal the same cell in AD and the the P&L calculation proceeds as normal down the column of visible cells?

I guess the long and short of it is that any cell in CG will be equal to the same cell in AD + any visible cells in AD above the current row

Is that making sense at all?

cheers
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi Honkin,

Try in CG3
Excel Formula:
=AGGREGATE(9,3,$AD$2:AD3)
 
Upvote 0
Hi Honkin,

Try in CG3
Excel Formula:
=AGGREGATE(9,3,$AD$2:AD3)
That looks to have done it @Toadstool, so thanks very much. The downside is that with 172,000 rows, the autocalculate option makes the sheet constantly try to update, which takes quite some time. A shame, as I'd hoped this might be the perfect way to have the sheet be 100% dynamic with its calculations like drawndown, peak profit etc

cheers
 
Upvote 0

Forum statistics

Threads
1,215,731
Messages
6,126,532
Members
449,316
Latest member
sravya

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