# Merging two sheets in Excel



## robkalscheur (Mar 25, 2009)

Hello. I am looking to merge two sheets in excel. 

The first sheet has columns with a customer number, customer name, address 1, address 2, city, st, and zip. On the far right columns there is various products. Some customers have several different products, and therefore several different rows.

The second sheet has columns with the same customer numbers, but no data filled in for customer name, address 1, address 2, city, st, and zip.

How can use the matching customer numbers from both sheets in order to automatically fill in the address info on sheet 2? Sheet 1 only has 181 rows, whereas Sheet 2 has over a thousand. Doing manually would take forever.

Thanks!!


----------



## macropod (Apr 11, 2008)

Hi robkalscheur,

You could do this with with Excel's LOOKUP function, or by combining its INDEX and MATCH functions.

For example, suppose your customer IDs are in column A on both sheets and 'address1' is in column B on Sheet2, you've got a customer ID in A1 of Sheet1 and you're wanting to put the 'address1' value from sheet2 into B1 on Sheet1. In that case, you could use:
=LOOKUP(A1,Sheet2!A:A,Sheet2!B:B)
or
=INDEX(Sheet2!B:B,MATCH(A1,Sheet2!A:A,0))
The INDEX and MATCH combination works better than the LOOKUP function if your customer IDs on Sheet2 aren't sorted.


----------



## robkalscheur (Mar 25, 2009)

Yes, this worked! Thanks a ton!!


----------

