View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MM
 
Posts: n/a
Default referencing non-blank cells

It doesn't quite work, I'm afraid.

What I have (in row I) is : 12
3 spaces
11
7 spaces
11
7 spaces
12
3 spaces

Your formula gives the correct value (36) for the first occupied row but
then gives 33 instead of 77 for the second and #N/A for the last two. My
guess is that this is due to MATCH requiring the array to be sorted (which it
can't be), but I've never used arrays before, so I'm only guessing.

I'll keep plugging away - at the very least you've opened a new avenue of
exploration for me!

Cheers, MM

"Herbert Seidenberg" wrote:

Assuming the blank cells do not contain zeros,
(but may contain a formula that results in blanks),
and the input column starts at A1 and is named set1 with
Insert Name Define
set1 Refers To: =A1:A100
seq1 Refers To: =ROW(INDEX(A:A,1):INDEX(A:A,ROWS(set1)))
Into B1 enter this array formula with Cntrl+Shift+Enter
=IF(set1 1:1="","",(MATCH(1,--((set1<"")*seq1ROW()),0)-ROW()-1)
*set1 1:1)
and copy down.