View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Lauri Lauri is offline
external usenet poster
 
Posts: 13
Default Look up functions and a one to many relationship

In actuality, sheet one will have upwards of 600 records with unique
customer info and customer id numbers, sheet two currently has 80,000
records/rows - not all of which have a match (single or otherwise) in sheet
one.

Why? Will this make a difference????

"Pete_UK" wrote:

In Sheet 2 put this formula in C1:

=A1&"_"&COUNTIF(A$1:A1,A1)

and copy down. In Sheet 1 you need a header row, so insert a row at
the top if you don't already have one. You can put "ID" and "Name" in
A1:B1, then in C1 across enter the numbers 1, 2, 3, 4 ... etc.

Then in C2 you can enter this formula:

=IF(ISNA(MATCH($A2&"_"&C$1,Sheet2!$C$1:$C$100,0)), "",INDEX(Sheet2!$B
$1:$B$100,MATCH($A2&"_"&C$1,Sheet2!$C$1:$C$100,0)) )

I have assumed you have 100 rows of data in Sheet2 - adjust to suit,
then copy the formula across for as many columns as you wish. Then
copy these formulae down into as many rows as you need.

Hope this helps.

Pete


On Nov 13, 5:55 pm, Lauri wrote:
Creating a report - What function can I use to look up a value from one
column in sheet 1 and find all rows in sheet 2 that contain the matching
value?

Sheet one contains Customer Identification numbers. (Oh, and the same
Customer can have multi ID numbers - unique to address)
Sheet two contains product information for the customers.

EX:
Sheet 1:
123 Invotech
146 Bank of Trusted Presidents

Sheet 2:
123 spreadsheet
123 word processing
123 accounting
123 payroll
146 accounting
146 pos retail
146 health services

Report should show the customer name and columns across with the product
names.