I have a Google Sheets spreadsheet which has intermittent data. I have a column where I'd like to calculate the difference between the first value in each row, and the last value in that row. The first and last columns aren't always the same.
Here you can see that Row 2 has a value in B2
and E2
so the calculation in A is =E2/B2-1
Row 3 has a value only in C3
and D3
, so the calculation is =D3/C3-1
How can I make the formula in A automatically detect and use the first value and the last value for the calculation?