Extract data from a table

S

shnim1

Hi

I have data in four columns. Column A have numbers in the cell
(numbers between 1-20), column B with numbers 1-5, colum C with number
1-6. These numbers are not in any kind of order and sometimes repea
themselves (shown more than once). In colum D I have text in each cell
What I need to do is to extract the line of text that corresponds to
row that meets a number criteria.

For example:
I get numbers 16, 4, and 2 (colums A. B and C). I need to know what th
text is in column D that has these three numbers in its row. I hav
tried:

=sumproduct(--(a1:a20=16),--(b1:b20=4),--(c1:c20=2),(d1:d20))

but that just wants to add the cell value in coilumn D and return
value of zero

please can anyone help

Cheers in advanc
 
M

Max

=sumproduct(--(a1:a20=16),--(b1:b20=4),--(c1:c20=2),(d1:d20))

To retrieve from d1:d20, use the index / match "equivalent":
=index(d1:d20,match(1,(a1:a20=16)*(b1:b20=4)*(c1:c20=2),0))
Array-enter the formula above by pressing CTRL+SHIFT+ENTER
 
R

Ron Coderre

With
A1:A100 contians numbers between 1 and 16
B1:B100 contains numbers between 1 and 5
C1:C100 contains numbers between 1 and 6
D1:D1000 contains text

Try this:
F1: 16
G1: 4
H1: 2

I1: =LOOKUP(F1&G1&H1,A1:A100&B1:B100&C1:C100,D1:D100)

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP
 
R

Ron Coderre

Oops! That only works if the column A through C data is sorted ascending!

This one actually works:
(Using the same rules I posted before)

I1: =INDEX(D1:D100,MATCH(F1&G1&H1,INDEX(A1:A100&B1:B100&C1:C100,0),0))

or...the array formula version (commited with ctrl+shit+enter)
=INDEX(D1:D100,MATCH(F1&G1&H1,A1:A100&B1:B100&C1:C100,0))

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
S

shnim1

Thabnks...it worked like a charm!

To retrieve from d1:d20, use the index / match "equivalent":
=index(d1:d20,match(1,(a1:a20=16)*(b1:b20=4)*(c1:c20=2),0))
Array-enter the formula above by pressing CTRL+SHIFT+ENTER
 
M

Max

Good to hear that. You're welcome.

Do try out the alternatives from the other responders as well ..
It's always good to know the options available.
 

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