TheAngryAuditor
TheAngryAuditor

Reputation: 39

"Dynamic" cell subtraction in a column with potential blanks

I am trying to make a table where a cell in each subsequent row subtracts from the previous one to show the change between the two. The problem is each row isn't always populated so something like A2-A3 then A3-A4, A4-A5, etc. will not work.

How can I skip blank rows in the formula to achieve a result like shown in the attached image (A6 being subtracted from A3 since A4/A5 are blank).

Thanks,

enter image description here

Upvotes: 0

Views: 79

Answers (1)

user4039065
user4039065

Reputation:

In b3,

=if(a3<>"", abs(a3 - index(a:a, match(1e99, a$1:a2))), "")

I wasn't sure how you wanted to handle the subtraction so I made the difference an absolute value.

Upvotes: 2

Related Questions