Consulting

Results 1 to 6 of 6

Thread: 4 way Lookup but last lookup is a function query?

  1. #1
    VBAX Tutor
    Joined
    Jul 2015
    Posts
    212
    Location

    4 way Lookup but last lookup is a function query?

    I have an index match array formula:

    {=IFERROR(INDEX(BD$2:BD$902,MATCH(AV$2&AW$2&AV5,BA$2:BA$902&BB$2:BB$902&BC$ 2:BC$902,0)),"")}

    At this point it's a 3 way lookup. I want to introduce a 4th column to lookup (BE$2:BE$902). However rather than each cell being filled with a static value, I want to introduce a different ">=" or "<=" a numeric value in each column cell. Example BE$2 is >=2.0, BE$3 is <=3.4,.....

    I know I could do it by introducing a horizontal index of values but there would be 100's. Any ideas welcome.

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Can you provide sample data for you 3 and 4 way lookups.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Tutor
    Joined
    Jul 2015
    Posts
    212
    Location
    mdm.. The 4th lookup value is PRICE in col AU$5:AU$22. This is referenced in col BD$2:BD$902 and then indexed in col BE$2:BE$902. For the attached example, cell AW5 should return "LAY".
    Thanks
    Attached Files Attached Files

  4. #4
    VBAX Expert shrivallabha's Avatar
    Joined
    Jan 2010
    Location
    Mumbai
    Posts
    750
    Location
    Possibly (Normally entered):
    =LOOKUP(2,(1/(($BA$2:$BA$23=$AV$2)*($BB$2:$BB$23=$AW$2)*($BC$2:$BC$23=$AV5)*COUNTIF($AU5 ,$BD$2:$BD$23))),$BE$2:$BE$23)
    copy down
    Regards,
    --------------------------------------------------------------------------------------------------------
    Shrivallabha
    --------------------------------------------------------------------------------------------------------
    Using Excel 2016 in Home / 2010 in Office
    --------------------------------------------------------------------------------------------------------

  5. #5
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    No good with these complex formula but a simple change to INDEX(BE$2:BE$902, returns the LAY from row 4. Doesn't fill down though.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  6. #6
    VBAX Tutor
    Joined
    Jul 2015
    Posts
    212
    Location
    shrivallabha, that does the trick. Well done and without an array formula.
    Cheers

Posting Permissions

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