Making Excel VLOOKUP Function to Work


I have seen many times that there are some scenarios where the Excel VLOOKUP function is not able to calculate the value we are looking for. For example, let's search the amount for the ID 16 according to a little table with this value.

Vlookup not bringing the right value

This is something really easy to do, we need only to use VLOOKUP function selecting the ID, the matrix and the column to be search.

Select the matrix to search on

However, when you see the result of this function you notice that there's an error despite the values are fine.

Error shown in the cell

The reason of this error is that the searched ID value is stored as text, so you can convert it in number in this case because it's only one value, but what if it were a thousand of them?.

Problem on the cell format

To avoid worrying about format issues just embraces the key value in the VALUE function inside the VLOOKUP function.

Use the Value function to get the value of a text

Once you use the function you are going to get the value that corresponds to the ID.

The Vlookup function will work

Consider that this is an example where the VLOOKUP function won't work as we want, I helped many people with this to solve another kind of problems with this function.

Comments

  1. mate, thnx! I like it! That is an extremely essential Excel function and this is very good explanation. You should even do something for the Index Match that does basically the same thing of the VLookup ;)

    ReplyDelete

Post a Comment

Popular posts from this blog

I Need to Send an Automatic Email with Lotus Notes

Inserting Rows o Columns in Excel Not Permitted

Turn Horizontal Visio Swimlanes into Vertical Ones