Explanation

The general goal is to return the first numeric value in a row or column.

Notice that all of the cells in this range have numeric values.

Some are blank and some contain text values.

The result of typing the number 12 into cell C7

We want thefirst numberthat appears in the range C5:C16.

Both methods are explained below.

XLOOKUP function

TheXLOOKUP functionis a modern upgrade to the VLOOKUP function.

The result of typing the number 12 into cell C7

XLOOKUP is flexible and can handle many different lookup scenarios.

The FALSE values indicate cells that either contain text values or are empty, such as cell C16.

This array is then returned directly to the XLOOKUP function as thelookup_array.

The result of typing the number 12 into cell C7

Testing the formula

This formula is dynamic and will always return the first numeric value.

To test the formula, we can add the number 12 to cell C7.

This formula uses the same logic as the XLOOKUP formula above.

The result of typing the number 12 into cell C7

The MATCH function is used to find the position of the first numeric value in C5:C16.

For more details, seeHow to use INDEX and MATCH.

XLOOKUP supports approximate and exact matching, wildcards (* ?)

The result of typing the number 12 into cell C7

you’re free to use INDEX to retrieve individual values, or entire rows and columns.

MATCH supports approximate and exact matching, andwildcards(* ?)

Excel formula: Get first text value in a range

Excel formula: Get first non-blank value in a list

Excel XLOOKUP function

Excel ISNUMBER function

Excel INDEX function

Excel MATCH function

Article image

Article image