Hi guys,
I'm have an issue in Excel, which I'm so far not able to solve. I try to return the first cell in a row, containing either a number or a specific character. Let's say I have the following row:s
XXO22O
XXXXXX
22OOXX
I want the function to return the first row containing an "O" or a number, but not the X. The results here should be: first row: value in column 3/second row: #N/A/third row: value in column 1.
I have the following seperate functions:
Formula:
INDEX(A1:A6;MATCH("O";B2:K2;0))
to match for an "O"
Formula:
INDEX(B2:K2;MATCH(TRUE;ISNUMBER(B2:K2);0))
to match for any number.
I have combined these in a somewhat ugly formula usign an IF statement to see which of the previous formulas results' occurs earlier, e.g. has a lower column number, and return thr value of that result. I tried to post the formula as well, but got the following error message: Block reason: Your request was not authorized due to its content (HTML code not allowed)
This simply looks at the column number, and gives the value of the cell that has the lowest column number. This would work when I only needed to match for one character and a numeric value However, this is a simplified example, in the real sheet I have to match for a number, or a possible 5 characters. Working this out with the above method would result in a long and complex formula. I am hoping there is a way to vombine the multiple matches I need into one INDEX formula, so that it returns the cell value of the first match that is true.
I'm looking forward to your input, if this is at all possible. Thank you in advance.
Kind regards,
Bart
Bookmarks