23.08.2023 Views

CFI-Excel-eBook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The Corporate Finance Institute Excel

Example 2

Suppose we wish to get the first non-blank value (text or number) in a one-row

range, we can use an array formula based on the INDEX, MATCH, and ISBLANK

functions.

We are given the data below:

Here, we want to get the first non-blank cell, but we don’t have a direct way to

do that in Excel. We could use VLOOKUP with a wildcard *, but that will only

work for text, not numbers.

Hence, we need to build the functionality by nesting formulas. One way to do it

is to use an array function that “tests” cells and returns an array of TRUE/FALSE

values that we can then match with MATCH. Now MATCH looks for FALSE

inside the array and returns the position of the first match found, which, in this

case, is 2. Now the INDEX function takes over and gets the value at position 2 in

the array, which, in this case, is the value PEACHES.

As this is an array formula, we need to enter it with CTRL+SHIFT+ENTER.

We get the results below:

Click here to download the sample Excel file.

corporatefinanceinstitute.com

93

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!