-1

I have two Excel sheets. I want to copy name and address into D and E columns of sheet 1 from sheet 2 if both sex and age match.

sheet 1 has three columns; case_no, age and sex sheet 2 has; no, age, sex, Address and name

How can I do this using Excel 2007.

Sheet 1
case_no age sex
101 23 F
102 18 F
103 45 M
208 64 F
209 19 M

Sheet 2

 no     name  age   sex address
101     Abe   56     M   dilla
209     zedo  19     M   bonga
206     rute  18     F   saris
70      hana  67     M   paissa
102     Feve  45     F   masr
103     sara  23     F    AA
107     Sam   64     F   wolo
Dave Anderson
  • 11,836
  • 3
  • 58
  • 79
user8328
  • 31
  • 5
  • This question cannot even be speculated upon without samples data from each worksheet together with expected results. –  Sep 05 '15 at 07:23

1 Answers1

0

Assuming case_no and no are in the A1 cells, a simple way would be to insert a new ColumnA into Sheet2 and populate it with:

=D2&E2   

Then in Sheet1 D2:

=IFERROR(VLOOKUP($B2&$C2,Sheet2!$A:$F,3,0),"")  

and E2 copy the above across and change the 3 to a 6 before copying the pair down to suit.

However if there is more data and it includes people of the same age and sex then only the first to be found will be returned.

pnuts
  • 58,317
  • 11
  • 87
  • 139