Need a formula to subtract the last value from penultimate value

pedro-egoli

Well-known Member
Joined
Apr 25, 2004
Messages
1,217
Office Version
  1. 2016
Platform
  1. Windows
In my workbook sheet 2 in column D has balances that are added to periodically.
In sheet 1 I need a formula in cells P25:P100 that will give me the sum of last value minus the penultimate value.
EG Sheet 2 D9 is last cell and i need D9-D8 to show up initially in sheet 1 P25 and continue until D10 becomes the last value in sheet 2 when in say S25 would show balance of sheet 2 D10-D9
Thanks
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
So, you want Sheet 1 P25 to give Sheet 2 (D9-D8) but when data is entered in at Sheet 2 (D10) you want the answer to (D10-D9)?
Where do you want this new result?
Sheet 1 (P25) or
Sheet 1 (P26)
Why have you mentioned P25:P100? W
 
Upvote 0
Thanks QuestionBaker,
Best explained with an extract from sheet 1 and 2
Sheet 1 looks like this (columns A:D)
8/07/2020$703,186$703,186$399,407
9/07/2020$694,358$694,358$391,908
11/07/2020$707,185$707,185$401,942

and Sheet 2 is the desired result (Row P25:R25)
9/10/202010/07/202011/07/2020
-$7,499-$7,499$10,034

I want to see in sheet 2 the daily change in movement in column D shown in row 25 starting at P25 and dragged across row
 
Upvote 0
26Aug19.xlsx
ABCDEFGHIJ
17/9/20207/10/20207/11/20207/12/20207/13/2020
27/8/2020$703,186 $703,186 $399,407 ($7,499)($7,499)($7,499)$10,034  
37/9/2020$694,358 $694,358 $391,908
47/12/2020$707,185 $707,185 $401,942
Sheet12
Cell Formulas
RangeFormula
G1:J1G1=F1+1
F2:J2F2=IF(F1>MAX($A2:$A10),"",INDEX($D2:$D10,MATCH(F1,$A2:$A10))-INDEX($D2:$D10,MAX(MATCH(F1,$A2:$A10)-1,1)))
 
Upvote 0
how are you calculating for 10/07/2020?
I do not see any entry over there, so is it has to repeat 9/7/2020 - 8/7/2020?
and the 10 in 9/10/2020 in sheet 2 of your example, is it a typo or is it intended?
 
Upvote 0
Thanks Amit Tandon,
Your solution looks very promising.
Will need to convert to my 2 worksheets
Question Baker,
Because there was no entry on 10/7/20 I just want the previous figure from 9/7/20to appear
Good pick up with the 9/10/20 should have been 9/7/20
 
Upvote 0
Amit Tandon ,
Just to let you know i got our solution to work using my 2 sheets.
Thank you
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

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