Find Name with an ID number, VLOOKUP FUNTION!

Jader04

Board Regular
Joined
May 4, 2009
Messages
53
I have a upcoming appointment that after i type the CUSTOMER ID I want to find the customer name automatically.
use this formula

=IF(NOT(ISNA(VLOOKUP(D7,Customer_Data,1,0))),VLOOKUP(D7,Customer_Data,1,0), IF(NOT(ISNA(VLOOKUP(D7,Commercial_Data,1,0))), VLOOKUP(D7,Commercial_Data,1,0), ""))

but is not working

plus i have some screen shots here for better understanding

http://snag.gy/PT8Tz.jpg (their is two sheet of customer data, one is residential and the other one is commercial data)

http://snag.gy/b1LDr.jpg
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
What value are you hoping to return? What do you mean by not working? The value you are looking up in your example doesn't appear to be in the list of customers.

The biggest thing I see is that the customer number you are looking up is in the last column in your data and you reference in your formula column 1 as the column you want the returned data to be from?
 
Last edited:
Upvote 0
Vlookup must have the lookup value on the far left of your table array and can only then look up items to the right of the matching values.

Try using Index and Match.

<code>=INDEX(column with data you want,MATCH(value you are looking for, column which contains this data,0))</code>
 
Upvote 0
the value i want is the customer name( residential or commercial)

if you see the screen shot, the value is on the other tab.(commercial)
 
Upvote 0
I see a picture with customer number CU0002 and the other picture has customer numbers that begin with RU, that's why I asked.
If you want to use VLookup the customer number needs to be in the left column and then you specify which column to the right of this the data you want to return is in. Just as stated by Beyond_avarice above. The suggestion to use Index Match would work if the value you want to return is to the left of the customer number.
 
Upvote 0
the problem here that i have two sheets and return N/A value with the index and match function

i guess i dont know how to put both sheets in the one formula
 
Upvote 0
It works with one sheet but when you have two sheet how i tell find that number on page of residential or commercial
 
Upvote 0
the problem here that i have two sheets and return N/A value with the index and match function

i guess i dont know how to put both sheets in the one formula

Use an if statement, if first formula not(isna), then use first formula otherwise use second formula.
 
Upvote 0
ok i can do it one sheet but i guess i don't know how to use the if(not function
=IF(NOT(INDEX('Recidential Data'!A4:A555,MATCH(D7,'Recidential Data'!I4:I555,1))),IF(NOT(INDEX('Commercial Data'!A4:A555,MATCH(D7,'Commercial Data'!L4:L555,1)))

return Value
 
Upvote 0
Try this:
Residential is misspelled, but if that how your sheet is actually spelled then leave it alone, otherwise correct the formula.

Code:
=CHOOSE(IF(ISNUMBER(MATCH(D7,'Recidential Data'!I4:I555,0)),1,IF(ISNUMBER(MATCH(D7,'Commercial Data'!L4:L555,0)),2,3)),INDEX('Recidential Data'!A4:A555,MATCH(D7,'Recidential Data'!I4:I55,0)),INDEX('Commercial Data'!A4:A555,MATCH(D7,'Commercial Data'!L4:L555,0)),"No Match Found")
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,397
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top