Trying to calculate a daily percentage change

UpToTheGills

New Member
Joined
Aug 26, 2022
Messages
38
Office Version
  1. 2019
Platform
  1. MacOS
Hi, firstly, if nothing else, thanks for taking the time to read my question even if my explanation is poor and/or you are unable to help.

Usually I can figure out the solution from googling but this particular problem has proved a little more difficult.

In summary, I have a trading journal with a worksheet to input details of trades and a worksheet to display daily statistics. What I can't figure out is how to calculate the percentage gain or loss compared to the previous trading day (which isn't necessarily the day before).

I've figured out how to calculate total gain/loss from any particular day but I can't figure out how to look up the last running total figure from before the day in question.

Existing formula that isn't quite working:
Code:
=IF(OR(ISBLANK(W5),W6=0,COUNTBLANK(W6)),"",(SUMPRODUCT(--(INT('TradeInputSheet'!$B$3:$B$328)=W5),'TradeInputSheet'!$T$3:$T$328)/(SUMPRODUCT(--(INT('TradeInputSheet'!$B$3:$B$328)<W5),'TradeInputSheet'!$W$3:$W$328))))

Ignore the first part of the code - the part in question in from (SUMPRODUCT...

Screenshots below - thanks in advance for any pointers.

excel.jpg


Screenshot 2022-08-26 at 11.27.42.png


So, hopefully the images will help with explaining what I am attempting to achieve.
Take the date, e.g. 25-Aug-22, total up all the gains/losses for that date on the Trade Input Worksheet (Total A), then calculate that gain or loss compared to last total of the previous day (B).
 
Thanks - that works great! 👍

Final alternative working formula:
Excel Formula:
=IF(OR(ISBLANK(W5),W6=0,COUNTBLANK(W6)),"",W6/INDEX(TradeInputSheet!$W$3:$W$328,MATCH(MAXIFS(TradeInputSheet!$D$3:$D$328,TradeInputSheet!$D$3:$D$328,"<"&W5),TradeInputSheet!$D$3:$D$328,0)))
 
Last edited:
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,215,067
Messages
6,122,949
Members
449,095
Latest member
nmaske

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