Conditionally Minus Result

Stephen_IV

Well-known Member
Joined
Mar 17, 2003
Messages
1,168
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I have an issue. What I am trying to is to minus the last 2 results in a column. As you can see below. We do attendance daily. What I would like to do is minus the last to figures greater than 0. In the case below it will be =B5-A5 for the next day it will be =C5-B5 Etc. Can someone please help me with a formula. Thanks in advance Stephen.<
Book1
ABCDEFGHIJKLMNOPQR
112378910111415161718212223
2911
31011
4712
52634000000000000008
Sheet1
Book1
ABCDEFGHIJKLMNOPQR
112378910111415161718212223
291111
3101110
471214
526343500000000000001
Sheet2
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Is this not as simple as typing =B5-A5 in cell B6 and then copying this across row 6?
 
Upvote 0
Stephen,

Channge the SUM formula in A5 to:

=IF(COUNT(A2:A4),SUM(A2:A4),"")

Define BigNum as referring to:

=9.99999999999999E+307

Then invoke for substraction:

=LOOKUP(BigNum,A5:P5)-LOOKUP(BigNum,INDEX(A5:P5,MATCH(BigNum,A5:P5)-1))
 
Upvote 0
Similarly:

=INDEX(A5:P5,1,MATCH(9.99999999999999E+307,A2:P2))-INDEX(A5:P5,1,MATCH(9.99999999999999E+307,A2:P2)-1)
 
Upvote 0
Aladin Akyurek, Andrew Poulsom,

Thank you so much. Worked perfectly!
 
Upvote 0

Forum statistics

Threads
1,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

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