Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Simple Vlookup hiccup. Can someone help me please?

I have the following set of example data in a database:

Name Values
Car 0
*Car 10.85
Bus 0
*Bus 21.20
Van 0
Truck 9.90

I am using the following Vlookup to gather "values" based on "name"

=VLOOKUP(A1,'LookupSheet'!$A$1:$B$7,2,FALSE)

I want my results to look like this (based on the vlookup):

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Name Values
Car 0
*Car 10.85
Bus 0
*Bus 21.20
Van 0
Truck 9.90

But what I end up getting is the following (values for Car and Bus without the * where there should be none):

Name Values
Car 10.85
*Car 10.85
Bus 21.20
*Bus 21.20
Van 0
Truck 9.90

What am I doing wrong? Is there anyway I can modify the Vlookup code such that I only get values for the names with a * where there are 2 instances of the same name (one with a * and one without)?

Sorry, I am new to Excel and trying to learn!
Any help would be much appreciated 🙂

>Solution :

You need to escape the * which otherwise acts as a wildcard in the VLOOKUP.

try:

=VLOOKUP(SUBSTITUTE(A1,"*","~*"),'LookupSheet'!$A$1:$B$7,2,FALSE)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading