Using Excel Lookup Function and Handling Case Where No Matches Exist

Posted by Dave on Super User See other posts from Super User or by Dave
Published on 2010-04-20T11:01:00Z Indexed on 2010/04/20 11:03 UTC
Read the original article Hit count: 168

Filed under:
|

I'm using Excel to enter data for an event where people register. A high percentage of the registrants will have registered for previous events, so we can their name and ID number.

I'm trying to use the LOOKUP function in Excel to lookup the name and then populate the ID field with their ID number.

This works well unless the value that is looked up is a new user that we don't already have details for.

However, if the LOOKUP function can not find an exact match, it chooses the largest value in the lookup_range that is less than or equal to the value. This causes a problem since you can't tell if the match was exact (and the data is correct) or not exact and the match is incorrect.

How do I catch non-matches and handle separately?

© Super User or respective owner

Related posts about excel

Related posts about data-validation