+ Reply to Thread
Results 1 to 2 of 2

Look up info in a database using 2 conditions

  1. #1
    cbuker
    Guest

    Look up info in a database using 2 conditions

    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!

  2. #2
    cbuker
    Guest

    RE: Look up info in a database using 2 conditions


    =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

    "cbuker" wrote:

    > 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!


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1