+ Reply to Thread
Results 1 to 9 of 9

Vlookup next largest value

  1. #1
    Forum Contributor wmorrison49's Avatar
    Join Date
    09-25-2007
    Posts
    267

    Vlookup next largest value

    Hello all:

    Here's what I am trying to do. I enter a value into a A1 and then depending on what that value is, I want to return a multiplier. To make it simple, let's say my VLOOKUP table arrary is:

    C D
    0 0
    2000 0.2
    4000 0.35
    6000 0.5
    8000 0.65
    10000 0.85
    20000 1.0

    Let's say I want to look up 3000 and I want it to return the higher value in the VLOOKUP, so 0.35 rather than 0.2. I know that if I do

    VLOOKUP(A1,C1:D7,2,TRUE)
    it will return the lower number. How do I get it to return the higher number?

    Thanks for your help!

    Will

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try

    =INDEX(D1:D7,MATCH(TRUE,C1:C7>A1,0))

    confirmed with CTRL+SHIFT+ENTER
    not just ENTER
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    or sort descending (on col c)
    then
    =INDEX(C1:D7,MATCH(A1,C1:C7,-1),2)

  4. #4
    Forum Contributor wmorrison49's Avatar
    Join Date
    09-25-2007
    Posts
    267
    That gets me on the right track, but it doesn't quite do what I need it to. If I pick a number in the list (say 4000) I need the formula to return the normal VLOOKUP value. It's just when my lookup value is between the numbers in the list that I need it to jump up.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    the example i posted works.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by wmorrison49
    That gets me on the right track, but it doesn't quite do what I need it to. If I pick a number in the list (say 4000) I need the formula to return the normal VLOOKUP value. It's just when my lookup value is between the numbers in the list that I need it to jump up.
    Did you try my formula and confirm it with the CSE keys...

    It should do what you are asking.

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Try

    =INDEX(D1:D7,MATCH(A1,C1:C7)+(LOOKUP(A1,C1:C7)<>A1))

  8. #8
    Forum Contributor wmorrison49's Avatar
    Join Date
    09-25-2007
    Posts
    267
    Thank you everyone for your help! I got daddylonglegs' to work perfectly. Martindwilson, I didn't try yours because I did daddylonglegs' first but Iam sure it would have worked too, thanks for the help. NBVC, I did do the Shift+Ctrl+Enter thing and it worked but not when the lookup value was exactly matched in the list, it still returned the higher number.

    Thanks again!

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by wmorrison49
    Thank you everyone for your help! ... NBVC, I did do the Shift+Ctrl+Enter thing and it worked but not when the lookup value was exactly matched in the list, it still returned the higher number.

    Thanks again!
    My formula just needed a tiny tweek....

    =INDEX(D1:D7,MATCH(TRUE,C1:C7>=A1,0))

+ 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