View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default Matching Three columns and returning a value

You could insert a new column D in Sheet2 and fill it with this
formula:

=A2&B2&C2

and copy this down. Similarly, insert a new column H and put this
formula in H2:

=A2&F2&G2

and copy this down. Then in Sheet1 D2 you can put this formula:

=IF(ISNA(VLOOKUP(B2&A2&C2,Sheet2!D:E,
2,0)),IF(ISNA(VLOOKUP(B2&A2&C2,Sheet2!H:I,2,0)),"n ot
present",VLOOKUP(B2&A2&C2,Sheet2!H:I,2,0)),VLOOKUP (B2&A2&C2,Sheet2!D:E,
2,0))

Copy this down as required.

Hope this helps.

Pete

On Apr 28, 1:33*pm, Rob wrote:
I have a Spreadsheet with two sheets.
Sheet 1 has the following data in columns
Forname * * Surname * * *Birth Place * * * Nationality
Alan * * * * * * Jones * * * * * Liverpool
Allan * * * * * *Jones * * * * * Cardiff
David * * * * * *Ellis * * * * * * Manchester
David * * * * * *Ellis * * * * * * Leeds
Clive * * * * * * Newman * * *London
Sarah * * * * * Roberts * * * *Cardiff

Sheet 2 has the following
Surname * * *Forename * *Birthplace * *Nationality Forename Birthplace *
Natioanlity
Jones * * * * * Alan * * * * * * Liverpool * * *English * * Allan * * * *
Cardiff * * * Welsh
Ellis * * * * * * *David * * * * * Manchester *English * * David * * * *
Leeds * * * *English

etc

How can I insert in sheet 1 the nationality where all three varialble must
match
i.e. Alan Jones Liverpool = Jones Alan Liverpool and returns the text
English in Sheet 1