The catch is that not all of the 1000 invoice numbers exist in the source data.

In fact,most of the invoice numbers do not appear in column B.

Although this formula uses VLOOKUP twice, it runs quickly.

Excel formula: VLOOKUP two-way lookup

With very large sets of data, the calculation time can beminutes.

This is sometimes referred to as alinear search.

Approximate-match VLOOKUP is very fast

In approximate-match mode, VLOOKUP is extremely fast.

Excel formula: VLOOKUP calculate grades

For a complete VLOOKUP overview with many examples, seeHow to use VLOOKUP.

However, the problem is that VLOOKUP won’t return an error if a value is not found.

Instead, it may return an incorrect result that looks completely normal.

Excel formula: Get employee information with VLOOKUP

So, while the formula runs very quickly, the result is not reliable.

Obviously, this is not something you want to explain to your boss.

This may seem counterintuitive because we are calling VLOOKUP twice.

Excel formula: Merge tables with VLOOKUP

However, two fast operations are better than one slow operation.

The trick is to structure the formula in a way thatrequires an exact match result.

If wedo find the lookup value, we spin up the second lookup.

Excel formula: VLOOKUP without #N/A error

Otherwise, we return an error.

Remember,VLOOKUP defaults to an approximate match.

Then we test the result against the lookup value.

Excel formula: XLOOKUP binary search

In this configuration, VLOOKUPruns very fast.However, VLOOKUP may return an incorrect result.

One way around this problem is to use VLOOKUP twice, both times in approximate match mode.

#N/A means “not available” or “no value available”.

Excel VLOOKUP function

you’re able to use the NA function to display the #N/A error when information is missing.

Excel NA function

Article image

Article image

Article image