Calculating Drawdown After Autofiltering

honkin

Active Member
Joined
Mar 20, 2012
Messages
385
Office Version
  1. 2016
Platform
  1. MacOS
I have a sheet which keeps track of profit and loss. I also have a section far off to the right which tallies Total Win Equity, Peak Win Equity, Drawdown $ & Drawdown %

All of that works well when the sheet has the whole year showing, but often I wish to autofilter to look for profitable systems with various metric. Naturally this figures to the right falls over without having all cells available.

This is how they are calculated and I wonder how it could be handled so the sheet recalculates each time it is filtered.

1) Total Win Equity (CT) is simply a total of the cell above the current + the Profit or Loss (AD) in the row - =CT2+AD3

2) Peak Win Equity (CU) is the highest figure in Total Win Equity (CT) or Peak Win Equity (CU) - =MAX(CT3,CU2)

3) Drawdown $ (CV) is Total (CT) Win Equity less Peak Win Equity (CU) - =IF(CT19<N(CU19),CT19-CU18,"")

4) Drawdown % is the Drawdown $ (CV) divided by Peak Win Equity (CU) - =IF(CV19<>"",-CV19/CU19,"")

I am fairly certain that 3 & 4 will work fine when filtered, as they only calculate using the same row.

2 could possibly be handled using SUBTOTAL(104, but I was concerned this may not work correctly as there is no guarantee that there will be consecutive rows after autofiltering and the code is =MAX(CT3,CU2)

1 is also a worry for the same reasons as 2; no guarantee of consecutive rows after autofiltering

Cell Formulas
RangeFormula
CT18CT18=AD18+10000
CU18CU18=AD18+10000
CV18,CV20:CV25CV18=CT18-CU18
CW18:CW25CW18=IF(CV18<>"",-CV18/CU18,"")
CT19:CT25CT19=CT18+AD19
CU19:CU25CU19=MAX(CT19,CU18)
CV19CV19=IF(CT19<N(CU19),CT19-CU18,"")


Any suggestions as to a foolproof way to have them work, regardless of what filtering is done?

cheers
 
Last edited:

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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