Lookup

B

Bhavesh

Hello

I have to two worksheet in the workbook, the first is the data that will
have this columns date, time, nmbcalled, cost and duration and another
worksheet will have name and number.

Worksheet 1

A B C D
E F
1 Date Time nocalled cost duration
2 05/06 07:00 01234567 £2.90 00:20:00
3 06/06 08:00 01234568 £4.89 01:05:00

Worksheet 2

A B
1 Peter 01234567
2 John 01234568

I would like to have names in column F of worksheet 1, example for record 1
to have Peter and recd. 2 to have John.

I have tried to use vlookup function but it return with #N/A error.

here is the syntax =VLOOKUP(C2,Sheet2!A1:B6,1,FALSE)

I will appreciate any help on this issue.

Regards
Bhavesh
 
G

Guest

Hi

You need to swap your columns over. The VLOOKUP function can only look up
in a column and return values from the column's right.
Rather than
Peter 01234567
John 01234568
you'll have to use
01234567 Peter
01234568 John
for VLOOKUP to work.

Andy.
 
A

Ardus Petus

If you'd rather not move your columns,
Instead of VLOOKUP, use INDEX & MATCH

=INDEX(Sheet2!$A$1:A6,MATCH(B2,Sheet2!$C1:$C6,0),1)

HTH
 
B

Bhavesh

I have tried to use this synatx, its shows an error #N/A

Just wondering that we are on referring the Sheet1 ...

Is it possible to upload this excel file on the forum, so you can play with
it.

Regards
Bhavesh
 
A

Ardus Petus

Ooops! The corrcet formula is:
=INDEX(Sheet2!$A$1:$A$6,MATCH(B2,Sheet2!$C1:$C6,0),1)
 
Top