A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Looking up and matching data in different worksheets



 
 
Thread Tools Display Modes
  #1  
Old June 7th, 2010, 03:37 PM
thefreckles thefreckles is offline
Member
 
First recorded activity by OfficeFrustration: Apr 2008
Posts: 4
Default Looking up and matching data in different worksheets

Hi! I have two sheets in a workbook. In Sheet 1 I need to match the data in Column G plus the data in Column F to the data in Column C in Sheet 2. Any matches then need to return the data that is in Column A on Sheet 2 to Column J on Sheet 1.

e.g.

Sheet 1
Column F - First Name
Column G - Surname
Column J - (need to insert ID from Sheet 2)

Sheet 2
Column A - ID number
Column C - Surname, First Name

So Column J in Sheet 1 needs to look up the data in Column G (Surname) and then Column F (First Name), then look for matches in Column C (Surname, First Name) of Sheet 2 and then return in Column J Sheet 1 the data in found in Column A Sheet 2 (ID Number) for those matches.

e.g. Sheet 1 Column F is 'Peter', Column G is 'Smith'; I want Excel to find 'Smith, Peter' in Sheet 2, Column C, and then look for his ID in Column A, Sheet 2. This ID number should then be returned to Column J in Sheet 1 (for said Peter Smith).

I hope that makes sense! I have no idea how to go about it though. Any help much appreciated!
  #2  
Old March 15th, 2011, 11:21 PM
tarquinious tarquinious is offline
Experienced Member
 
First recorded activity by OfficeFrustration: Mar 2011
Posts: 34
Default

Quote:
Originally Posted by thefreckles View Post
Hi! I have two sheets in a workbook. In Sheet 1 I need to match the data in Column G plus the data in Column F to the data in Column C in Sheet 2. Any matches then need to return the data that is in Column A on Sheet 2 to Column J on Sheet 1.
Hey there theFreckles!

On the worksheet with the IDs in it, you will need to swap the name and ID columns over. The formula below relies on the name being in column A and IDs in column B. You can do this by highlighting all of column A by clicking on the A at the top, then clicking and holding the black border, and whilst holding down the Shift button, drag it to the right of the IDs.

Next to the first set of names in the first worksheet, type in:
=VLOOKUP(G2 & ", " & F2,Sheet2!A:B,2,FALSE)
...where "Sheet2" is the name of the worksheet with IDs on it

Copy and paste this down for each set of names and where IDs exist you will get the ID returned, where the name combo can't be found, you'll get a "#N/A" error.

Give it a crack and let me know if it does what you're after.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:45 PM.


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