#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Duplicate

I am trying to use Vlookup to return a value. I can get it to search for a
surname and then return the appropriate value but I have duplicate surnames
(jones etc!) that should return different values.

Currently my formula just returns the first value it finds. Can I lookup 2
columns (first name and surname?)

Would appreciate any help,

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default Duplicate

Hi

The problem here is that two people may have the same first and last name
John Smith.

But you can do a two column lookup if you want. Assume that the first names
are in column A, last names in column B starting on row 2. Suppose you enter
the first name of the person you want to look up in J1 last name in K1, and
finally suppose you want to return the age field with is in column C.

=INDEX($C$2:$C$4,MATCH(1,(J1=$A$2:$A$4)*(K1=$B$2:$ B$4)))

This formula must be array entered: press Shift+Ctrl+Enter to enter it.


If this helps please click the Yes button.
--
Thanks,
Shane Devenshire


"purplerose" wrote:

I am trying to use Vlookup to return a value. I can get it to search for a
surname and then return the appropriate value but I have duplicate surnames
(jones etc!) that should return different values.

Currently my formula just returns the first value it finds. Can I lookup 2
columns (first name and surname?)

Would appreciate any help,

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Duplicate

Hi,

Considering you have first name and surname in 2 different columns, you can
try this

=lookup(2,1/((range1="firstname")*(range1="surname")),lookup_r ange)

--
Regards,

Ashsih Mathur
Microsoft Excel MVP
www.ashishmathur.com

"purplerose" wrote in message
...
I am trying to use Vlookup to return a value. I can get it to search for a
surname and then return the appropriate value but I have duplicate
surnames
(jones etc!) that should return different values.

Currently my formula just returns the first value it finds. Can I lookup 2
columns (first name and surname?)

Would appreciate any help,

Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
duplicate amie etincelle Excel Discussion (Misc queries) 1 May 23rd 08 05:56 PM
duplicate name help please Terry Excel Worksheet Functions 9 February 20th 08 03:52 PM
Duplicate Look up Excel Crazy New Users to Excel 1 November 15th 06 02:35 AM
How do you delete duplicate addresses, but keep duplicate names? Shelly Excel Discussion (Misc queries) 1 August 28th 06 10:36 PM
Duplicate Bottle Excel Worksheet Functions 3 April 14th 05 04:57 PM


All times are GMT +1. The time now is 04:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"