The easiest way to solve this problem is with the XLOOKUP function.

XLOOKUP function

TheXLOOKUP functionis a modern upgrade to the VLOOKUP function.

XLOOKUP is very flexible and can handle many different lookup scenarios.

The value in cell C8 is returned after value in cell C6 is deleted

For more details, seeHow to use the NOT function.

It first uses ISBLANK to create an array with TRUE for blank cells and FALSE for non-blank cells.

This final array serves as the lookup array for XLOOKUP.

The value in cell C8 is returned after value in cell C6 is deleted

The TRUE values in the array indicate blank cells, and the FALSE values indicate non-blank cells.

The array is returned directly to the NOT function so that “reverse” the results.

Testing the formula

To test the formula, we can delete the value in C6.

The value in cell C8 is returned after value in cell C6 is deleted

This formula has basically the same logic as the XLOOKUP formula above.

The MATCH function is used to find the position of the first non-blank cell in C5:C16.

For more details, seeHow to use INDEX and MATCH.

The value in cell C8 is returned after value in cell C6 is deleted

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

When given TRUE, NOT returns FALSE.

When given FALSE, NOT returns TRUE.

The value in cell C8 is returned after value in cell C6 is deleted

Use the NOT function to reverse a logical value.

For example, if A1 contains “apple”, ISBLANK(A1) returns FALSE.

it’s possible for you to use INDEX to retrieve individual values, or entire rows and columns.

Excel formula: Get first text value in a range

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

Often, MATCH is combined with the…

Excel formula: Get first numeric value in a range

Excel formula: Get value of last non-empty cell

Excel XLOOKUP function

Excel NOT function

Excel ISBLANK function

Excel INDEX function

Excel MATCH function