Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
COUNTBLANK or SUMPRODUCT(TRIM(CLEAN(bla1:Bla2))="") at the end of the rows? –  Blomkvist May 5 '11 at 19:49
    
Hi Blomkvist, thanks for your reply. I tried your suggestion but unfortunately this counts every individual empty cell in the entire row... I am trying to find out how many contiguous blank cells exist at the end of a row... 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. –  Andy May 6 '11 at 15:14

1 Answer 1

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

SU279758 example

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.