1st non-zero value...
{=INDEX(A1:Q1,,SMALL(IF(ISTEXT(A1:Q1),ISTEXT(A1:Q1)*COLUMN(A:Q),""),1))}
2nd non-zero value...
{=INDEX(A1:Q1,,SMALL(IF(ISTEXT(A1:Q1),ISTEXT(A1:Q1)*COLUMN(A:Q),""),2))}
Note: These are array formulas which must be
entered using the Control+Shift+Enter key
combination. The outermost braces, {}, are not
entered by you -- they're supplied by Excel in
recognition of a properly entered array formula.
why does the first data have to be in column a?
I noticed that the formula doesn't work if you try to go b1:r1. However if I go a1:q1 it works. Any idea why?
Re: why does the first data have to be in column a?
{=INDEX(B1:R1,,SMALL(IF(ISTEXT(B1:R1),ISTEXT(B1:R1)*COLUMN(B:R),""),1))}
...should work just fine! Don't forget to enter
this array formula using the Control+Shift+Enter
key combination.
Oops! Now, I see your problem... Use this instead...
{=INDEX(B1:R1,,SMALL(IF(ISTEXT(B1:R1),ISTEXT(B1:R1)*COLUMN(B:R)-COLUMN(B:B)+1,""),1))}
If you prefer... You can also use...
{=INDIRECT(ADDRESS(ROW(),SMALL(IF(ISTEXT(B1:R1),ISTEXT(B1:R1)*COLUMN(B:R),""),1)))} {=INDEX(B1:R1,,SMALL(IF(ISTEXT(B1:R1),ISTEXT(B1:R1)*COLUMN(B:R)-COLUMN(B:B)+1,""),1))} : {=INDEX(B1:R1,,SMALL(IF(ISTEXT(B1:R1),ISTEXT(B1:R1)*COLUMN(B:R),""),1))} : ...should work just fine! Don't forget to enter