Look up info in a database using 2 conditions

G

Guest

I have 2 different data sets (ranges/matrices). Data set Able has 2 columns
(fields) and 25 rows (observations), and data set Baker has, say, 10 columns
and 1,000 rows.

I want to write a formula that returns the value in the 6 th column of Data
set Baker where the value in column 1 of Data set Baker matches the value in
the cell at the intersection of row 23, column 1 of Data set Alpha AND the
value in column 2 of Data set Baker matches the value in the cell at the
intersection of row 23, column 2 in Data set Alpha.

In other words, I want to lookup a value in the first data set where the
values in columns 1 and 2 match the values in columns 1 and 2 of row 23 of
the second data set.

Actually, I want to copy a set of the desired function/formula down the side
of Data Set Alpha to see if Data Set Baker has matches on both conditions for
each observation in Data Set Alpha, and if so, to return the value in the
matching row but in an adjacent column from Data Set Baker.

Logically, if one or more values in column 1 in Data set Baker equal the
value in cell A23, AND if one or more values in column 2 in Data set Baker
equal the value in cell B23, and if the match is unique (only one row
(observation) in Data Set Baker has matches in both columns), then give me
the value in column 6 of the Data set Baker row that contains the matches.

The lookup functions do this easily with only one criteria, and the
dfunctions seem like they would do it except I can't figure out how to make
them work because they require the column labels to be part of the criteria,
and this prevents one from copying the formula down the side of Data set
Alpha.

Thanks a million!
 
G

Guest

=INDEX($G$2:$P$1137,MATCH(A23&E23,$H$2:$H$1137&$I$2:$I$1137,0),6)

where the result I want is in the 6th column of $G$2:$P$1137, A23 and E23
are the values I am trying to match with values somewhere in columns H and I,
respectively, and I require an exact match (0).

Thanks Bob and Dave, and others.

Thank you
 

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