Double lookup!
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Double lookup!

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Hi

    I have 1 table with date in column A and and 3 digit code in column B. The 3 digit codes appear once each date. Columns C-H have the data which I want to fill cells in several other tables (each one for a diferent 3 digit code), set out by date.
    My aim if to create a formula which will go and get the data in C-H if A="date" and b="3 digit code" I have tried diferent combinations of match, Index, and Vlookup but cannot seem to get the data I want to fill the cells.
    I would also be interested in any macro solutions that would do the trick.

    cheers


  2. #2
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    81,872
    Post Thanks / Like
    Mentioned
    12 Post(s)
    Tagged
    1 Thread(s)

    Default

    Cyril,

    Lets say that A1:E3 houses the following sample data and you want to retrieve the value from val2 column of this table, which is associated with lookup values in G2 (a date) and H2 (a digit code).

    {"date","code","val1","val2","val3";
    37258,"023",3,4,5;
    37258,"024",6,45,8}

    Strange looking numbers are just dates in the internal representation that Excel uses for dates.

    In G2 we have: 1/2/02
    In H2 we have: 024

    In I2 enter:

    =IF(SUMPRODUCT(ISNUMBER(MATCH(G2&H2,$A$2:$A$3&$B$2:$B$3,0))+0),INDEX($D$2:$D$3,SUMPRODUCT(MATCH(G2&H2,$A$2:$A$3&$B$2:$B$3,0))),"")

    where $D$2:$D$3 in INDEX is the column from which we want to retrieve the associated value.

    Note. If you're going to use this formula in lots of cells, it will incur some performance costs.

    Aladin



  3. #3
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    I would suggest one of the Dfunctions as there is no recalcualtion trade-off. The help on these is very good. I also have some slightly more advanced uses here:
    http://www.ozgrid.com/download/default.htm
    DFunctionsWithValidation.zip

    You may also want to consider a Pivot Table

  4. #4
    New Member
    Join Date
    Mar 2002
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Hi again and THANKYOU!!

    I tried both your idea's but Aladins proved the more useful. Thanks for taking the time (altho your reply's were super fast!!)

    Cheers



User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com