Problem
We'd like to coalesce cells in a row in Excel. In our example we'd like the first non-blank occurrence found for each row.
Solution
- INDEX and MATCH in conjunction with ISBLANK
- INDEX and MATCH in conjunction with EXACT
{=INDEX(A2:F2,MATCH(FALSE,ISBLANK(A2:F2),FALSE))}
We need to press CTRL + SHIFT + ENTER to enter this array formula. This formula works fine as long as there are not zero-length string characters ("") in the cells. E.g.: row 5 in our example. Otherwise it will return that zero-length string instead of the first number.
{=INDEX(A2:F2,MATCH(FALSE,EXACT("",A2:F2),FALSE))}
We need to press CTRL + SHIFT + ENTER to enter this array formula. This will solve the issue of cells containing zero-length string characters.
Results
No hay comentarios:
Publicar un comentario