lookup multiple occurrences of a value excel

C

ckl

Hi,

can anyone suggest a way to lookup multiple occurrences of a value in excel
and return a value from a cell from a cell in the same row of each
occurrence. I want the values returned to each be in a separate cell.

thanks

e.g.

I want to put a lookup formula in columns e, f and g of row 2 in wkbk 1 that
would look at the isbn in a1, find it in wkbk 2, then return the first
occurrence 'po' for that isbn to e1, the second occurrence to f1 and the
third occurrence to g1.
can anyone help??

workbook 1
a b c d e f g
1 isbn title price code
2 1234 dog 500 1
3 5678 cat 100 2
4 9101 rat 100 3
5 1121 pig 300 4

workbook 2
a b
1 isbn po
2 1234 abc
3 1234 xyz
4 5678 def
5 1121 xyz
6 1121 hij
 
D

Domenic

Try the following...

E2, copied down and across:

=IF(COLUMN()-COLUMN($E2)+1<=COUNTIF(Sheet2!$A$2:$A$6,Sheet1!$A2),INDEX(Sh
eet2!$B$2:$B$6,SMALL(IF(Sheet2!$A$2:$A$6=Sheet1!$A2,ROW(Sheet2!$A$2:$A$6)
-CELL("row",Sheet2!$A$2)+1),COLUMN()-COLUMN($E2)+1)),"")

....confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 
R

RagDyer

Try this *array* formula in E2.

=INDEX(Sheet2!$B$1:$B$20,SMALL(IF(Sheet2!$A$1:$A$20=$A2,ROW($A$1:$A$20),""),
COLUMN(A1)))

Array formulas are entered with <Ctrl> <Shift> <Enter>, where, when done
correctly, will *automatically* be enclosed in curly brackets, which
*cannot* be done manually.

Then, just drag aross and down.

If no (ISBN) match is found, or there are less then 3 P.O.'s, the #NUM!
error will display.
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

Hi,

can anyone suggest a way to lookup multiple occurrences of a value in excel
and return a value from a cell from a cell in the same row of each
occurrence. I want the values returned to each be in a separate cell.

thanks

e.g.

I want to put a lookup formula in columns e, f and g of row 2 in wkbk 1 that
would look at the isbn in a1, find it in wkbk 2, then return the first
occurrence 'po' for that isbn to e1, the second occurrence to f1 and the
third occurrence to g1.
can anyone help??

workbook 1
a b c d e f g
1 isbn title price code
2 1234 dog 500 1
3 5678 cat 100 2
4 9101 rat 100 3
5 1121 pig 300 4

workbook 2
a b
1 isbn po
2 1234 abc
3 1234 xyz
4 5678 def
5 1121 xyz
6 1121 hij
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top