Closed Thread
Results 1 to 8 of 8

Vlookup next row

Hybrid View

  1. #1
    Mark
    Guest

    Vlookup next row

    I am attempting to use vlookup with values that have many decimal places.
    The problem is they are close enough for an exact match so I must use an
    approximate. I always get a value that is one before the value I wish to
    have because it takes a value lesser than the one I am trying to match. Is
    there a way I can get it to take the value in the next row? The numbers are
    in numerical order.

    Thanks

  2. #2
    JE McGimpsey
    Guest

    Re: Vlookup next row

    One way:

    Instead of

    =VLOOKUP(A1,J:K,2,TRUE)

    use

    =INDEX(K:K,MATCH(A1,J:J,TRUE)+1)


    In article <[email protected]>,
    "Mark" <[email protected]> wrote:

    > I am attempting to use vlookup with values that have many decimal places.
    > The problem is they are close enough for an exact match so I must use an
    > approximate. I always get a value that is one before the value I wish to
    > have because it takes a value lesser than the one I am trying to match. Is
    > there a way I can get it to take the value in the next row? The numbers are
    > in numerical order.
    >
    > Thanks


  3. #3
    Eddie O
    Guest

    RE: Vlookup next row

    You should be able to use the INDEX formula combined with MATCH to be able to
    do this. Assuming you're looking up the number 19.000001 in column A, and
    you're returning a result from column B, the formula could look like this:
    =INDEX(A1:B1000,MATCH(19.000001,A1:A1000,0)+1,2)
    There are 3 parts to the index formula, first you define the range you're
    looking at, second you define the row you want to return, and third you
    define the column you want to return. In the formula above, A1:B1000 is
    defined as the range, just like you'd do in VLOOKUP. The last number in the
    formula, 2, is the column you want to return (B). The MATCH formula in the
    middle section matches against your number, 19.00001, and then adds +1 to it,
    in order to return the following row.

    Hope this helps.
    Eddie O

    "Mark" wrote:

    > I am attempting to use vlookup with values that have many decimal places.
    > The problem is they are close enough for an exact match so I must use an
    > approximate. I always get a value that is one before the value I wish to
    > have because it takes a value lesser than the one I am trying to match. Is
    > there a way I can get it to take the value in the next row? The numbers are
    > in numerical order.
    >
    > Thanks


  4. #4
    Ron Coderre
    Guest

    RE: Vlookup next row

    This might be the easiest fix:
    Move the data to the right of the first column in your lookup range up one
    row. That way, even though the VLOOKUP is matching on the wrong value (by one
    row) the returned value will be correct.

    Does that help?

    ***********
    Regards,
    Ron


    "Mark" wrote:

    > I am attempting to use vlookup with values that have many decimal places.
    > The problem is they are close enough for an exact match so I must use an
    > approximate. I always get a value that is one before the value I wish to
    > have because it takes a value lesser than the one I am trying to match. Is
    > there a way I can get it to take the value in the next row? The numbers are
    > in numerical order.
    >
    > Thanks


  5. #5
    Herbert Seidenberg
    Guest

    Re: Vlookup next row

    Assuming you have a list named ListA
    18.523
    19.015
    20.648
    and you wish to look up either
    19.014 or 19.016, named Near,
    and get the same answer, 19.015,
    then you can use this array formula
    =SUMPRODUCT(--(MIN(ABS(ListA-Near))=ABS(ListA-Near))*ListA)
    entered with Ctrl+Shift+Enter.


  6. #6
    Registered User
    Join Date
    08-03-2020
    Location
    Marion, IN
    MS-Off Ver
    2016
    Posts
    3

    Question Re: Vlookup next row

    I could use some similar help with this as I have tried but there are some things not working still. it might because of my A2

    I have a spreadsheet made up for trips listing companies, codes, hotels, rates, etc.
    What I am trying to do is select the code and then have the spreadsheet populate all hotels for that coded company.

    I am using in A2 a data validation listing of all codes, so I can drop down the list and select the code. The greatest number of hotels for a company is 7.

    My Example
    A B C D
    001 NWP EXTENDED STAY $140.00
    001 NWP HOLIDAY INN $140.00
    001 NWP LAQUINTA $129.00
    017 AC HAMPTON INN $109.00
    017 AC HOLIDAY INN $89.10
    017 AC COUNTRY INN $123.49
    019 AFS BW+ $120.00
    019 AFS FAIRFIELD INN $104.00
    030 BBB COURTYARD $100.00
    047 TAZ COMFORT STES $101.00
    047 TAZ QUALITY INN $84.15
    047 TAZ HOLIDAY INN $80.00

    What I want to return in my results is after I select from my A1 = Data Validation list of say, 017, it would look like this

    A B C D
    CODE CO HOTEL RATES
    A2=017 AC HAMPTON INN $109.00
    2 HOLIDAY INN $89.10
    3 COUNTRY INN $123.49
    4 #NA #NA
    5 #NA #NA
    6 #NA #NA
    7 #NA #NA

    I have used vlookup for rows 1-7, but it is always grabbing the next code/company, so there is a match problem; i have also used index and match, but the same is happening.

    I think I am on the right track, but again, in the example above, rows 4-7 are still bringing in data instead of #NA.

    Thoughts?

    using
    =VLOOKUP($A2,DATA!$A$2:$K$320,4, FALSE) = where DATA! is the next sheet with all of the er data
    =INDEX(DATA!A2:$K$320,MATCH(A2,DATA!A2:A320,0)+1,4)
    =INDEX(DATA!A2:$K$320,MATCH(A2,DATA!A2:A320,0)+6,4)


    THANKS FOR THE LOOK SEE!

  7. #7
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Vlookup next row

    Jenner, welcome to the forum.

    Your problem is sufficiently different that I recommend you start a new thread for your own problem.
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,447

    Re: Vlookup next row

    @JENNER

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

Closed 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