I'm working on a spreadsheet which needs to populate info for an entire year. What I need the Total Meter Worked columns to do is if the end meter is a zero, to populate a zero. If the end meter has a number, then to subtract the end meter from the previous month. However, if the previous month also has an end meter of zero, then it needs to go back to the previous month's previous month, etc.The formula works fine if it only goes back a month or two. However, if it has to go back to the start meter, I'm having issues. The first yellow cell in column AT should be 120 not 2763 (AS17-K17 i.e. 2763-2643) and the second yellow cell should be 83 not 3064 (AS21-K21 i.e. 3064-2981)The attached picture shows the formula I created.I need to be able to fill this in for 12 months and I know that IF formulas can only be used up to 7 times in a formula.I'm open to all suggestions including VBA possibilities.