Adding last non-zero value in a column

ELLIE94

New Member
Joined
Oct 1, 2017
Messages
1
I'm having problems setting up a formula.

This is what I have so far: =IF(AND(ISBLANK(E19),ISBLANK(F19)),0,INDEX(H10:H100,MAX((ABS(H10:H100)>0)*ROW(H10:H100))-(CELL("Row",H10)-1))+F19-E19)

I have an 'if' function, so if two cells are blank, then a 0 is returned in the total column.

Later if one of these columns is filled, then I want the figures added up. The issue is it takes the earlier 0, giving an incorrect total.

What I am trying to do is use a function to find the last non-zero value and add this to give the correct running total.

In the workbook it either gives a 0 value or says 'volatile' and I don't know what this means or why it is displaying. Any help would be greatly appreciated.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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