Results 1 to 5 of 5

Match/Index/Lookup - Searching From Bottom to Top (A reverse lookup maybe)

Threaded View

  1. #1
    Registered User
    Join Date
    05-31-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003/2007
    Posts
    31

    Match/Index/Lookup - Searching From Bottom to Top (A reverse lookup maybe)

    Hi All,

    I'm hoping someone can help me make this work. My sample data is as follows:

    A1:A6 = ("Letters",a,b,c,d,c)
    B1:B6 = ("Numbers",20,30,40,50,60)
    So basically two columns, one with the header "Letters" and one with the header "Numbers" with their respective content below them:
    Letters | Numbers
    a | 20
    b | 30
    c | 40
    d | 50
    c | 60

    Next you need to accept that this data cannot be sorted before it is searched due to the way other people are using the source data in this sample table.

    Now, I could use a forumla like the one below and it would return the value 40 (the first match for "c").
    Index(A1:B6, Match("c",A1:A6,0), Match("Numbers",A1:B1,0))
    But, there are two "c" values in Column A, I'm looking for something that will return the second match and it's corresponding value (60). Does anyone know a robust formula for doing this?

    The following formula achieves this:
    =LOOKUP(COUNTIFS($A$1:$A$6,"c"),1/($A$1:$A$6="c"),$B$1:$B$6)
    But:
    1. It's not as robust as Index(Match,Match) is when it comes to having columns and rows added
    2. I don't understand how it works, specifically this bit:
    1/($A$1:$A$6="c")
    How does that produce a [Lookup_Vector] for the lookup function?

    Can anyone help me to 'merge' these two formulas into a robust solution to lookup the bottom most value in a table?


    Thanks!
    Last edited by Neutralizer; 05-02-2013 at 02:20 AM.

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