Find the first or last populated column in a range
Commish wrote...
....
How can I write a formula in column a1, to tell me which was the first
column to have a value in row 1? And, likewise, I want to know which
column has the last value.
Most efficient ways
First column [array formula]: =MATCH(1,1-ISBLANK(C1:Z1),0)
Last column [array formula]: =MATCH(2,1/(1-ISBLANK(C1:Z1)))
If you want to treat cells evaluating to "" the same as blank (empty)
cells,
First column [array formula]: =MATCH(TRUE,C1:Z1<"",0)
Last column [array formula]: =MATCH(2,1/(C1:Z1<""))
|