Hi

Try this

S2: =MAX(IF(LEN(L2:Q2)>0,COLUMN(L2:Q2)-11))

This formula is array entered (ctrl, shift, enter).

Copy down as required.

rylo