You can take care of gaps by using construct like below.If no gaps eventually =MAX(A2:INDEX(A2:D2;COUNTA(2:2)-1))
It works perfectly thanks :D
It works perfectly thanks :DYou can take care of gaps by using construct like below.
=MAX(A2:INDEX(A2:F2,MATCH(2,1/ISNUMBER(A2:F2))-1))