+ Reply to Thread
Results 1 to 11 of 11

Three criteria irregular lookups

  1. #1
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Three criteria irregular lookups

    Without using helper columns, what is the best way to return a value from an array using three criteria from irregular data? The attached sample gives and example.

    Thanks for any ideas.
    Attached Files Attached Files
    Last edited by BRISBANEBOB; 09-14-2009 at 10:08 PM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Three criteria irregular lookups

    Can you use this custom function?

    3 Criteria VLOOKUP

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Three criteria irregular lookups

    First, fill in the holes in the range D7:D30. All the Plant 1 rows need to have a 1, so D7:D11 = 1, D12:D18 = 2, etc. You can color the font of those added numbers white if you really need them to "appear" blank.
    Fix the value in F37, it should be JUN, not June.

    Then put this formula in G36 and copy down:

    =INDEX($F$7:$Q$30, MATCH($D36 & $E36, INDEX($D$7:$D$30 & $E$7:$E$30, 0), 0), MATCH($F36, $F$6:$Q$6, 0))


    NOTE: Why does this feel like a homework assignment?
    Last edited by JBeaucaire; 09-14-2009 at 08:13 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    09-05-2009
    Location
    INDIA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Three criteria irregular lookups

    Mr JB, Certainly you are an expert in excel. can you please teach how to excel in excel vba.
    rsdharan

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Three criteria irregular lookups

    I learn by helping people here on the forum. People ask questions and I analyze the answers given until I finally understand them...which sometimes takes a while.

    Start trying to answer simpler questions...first on your own to see if the answer you come up with matches the answers provided later. As you match more and more, start offering answers of your own.

    The surest way to know you've learned something is to see if you can show it to someone else.

  6. #6
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: Three criteria irregular lookups

    Homework Assignment: I wish it was but I suspect at the age of 54 the days of homework are unlikely to reappear...

    JB - I like the Index 'double' Match. But...is there any way to do it without having to fill in the missing data? That would be fine for a small data array, and I understand the missing data could be populated pretty quickly, but is there any way without touching the data spreadsheet? i.e. if you were doing the index or lookup from another sheet?

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Three criteria irregular lookups

    I've shown you the way I would do it. As for populating the missing numbers, that, too, can be done very quickly with a "fill down" trick I can show you, but I would never substitute a robust flat INDEX/MATCH formula with a cumbersome array-beast just to skip the fill down. I'd do the fill-down.

    If you're interested in the quick fill-down trick, let me know.

  8. #8
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: Three criteria irregular lookups

    For fill downs I usually go to a helper column and use (assuming I am starting in C3 as the helper)

    "if(a5<>a4,+a5,+c3)"

    Is there another way using Fill?

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Three criteria irregular lookups

    Heck yeah. Learned it right here on the forum.

    1) Highlight the column of values including the blank cells.
    2) Press F5 and select Special
    3) Select Blanks and click OK
    4) Press the equal sign =
    5) Press UP ARROW one time
    6) Press CTRL-ENTER

    You've just inserted a formula into all those blank cells that displays the value of the cell above. To remove the formulas and leave the values, do a copy/edit/pastespecial/values.

  10. #10
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: Three criteria irregular lookups

    Awesome...absolutely awesome. How come that's not well know. Another 'undocumented' feature?

    Thanks again.

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Three criteria irregular lookups

    Don't forget to convert theose formulas to values if the data is going to be rearranged in any way.
    Entia non sunt multiplicanda sine necessitate

+ 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