Count the number of contiguous empty cells at the end of a row

openofficeopenoffice-calcworksheet-function

I have rows of data, some cells are empty and some contain a number. I need to identify how many contiguous empty cells exist at the end of each row.

I've tried using a string of nested IF statements, but there are often 15-20 empty cells and I don't think that I can have 20 nested IF statements (?).

for example: _ _ 1 2 _ _ 2 _ _ 1 1 1 _ _ _ _ (underscore represents a blank cell) For this row, there a 4 empty cells at the end of the row. I need to count empty cells (backwards from the end of the row) and then stop when a non-empty cell is reached.

Can anyone help?

Best Answer

It's been a while so I'm hoping a LibreOffice solution may be better than nothing:

SU279758 example

Related Question