+ Reply to Thread
Results 1 to 7 of 7

Lookup Next Highest Number

  1. #1
    Registered User
    Join Date
    09-17-2015
    Location
    Leicester
    MS-Off Ver
    2007
    Posts
    3

    Lookup Next Highest Number

    Hi all, Newbie here.

    I have a price list table that I would like to automatically price doors (Height x Width) after entering the width and height in cells M1 and M2.

    The table is in cells A1:A10, Heights are in cells A2:A10 and widths are in cells B1:J1. Cell A1 is blank.

    The formula I am using works fine if the entered width and height is in the above cells. If the entered value is not there it picks out the next lower number below the value but I would like it to go to the next higher value.

    For an example my height column looks like this:

    140
    175
    283
    355
    445
    570
    715
    895
    1245

    If I type 720 in cell M1 it will look at 715???

    This is the formula i'm using:

    =INDEX(A1:J10,MATCH(M1,A1:A10),MATCH(M2,A1:J1))

    Any help is much appreciated.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Lookup Next Highest Number

    Can you sort the table in DEscending order?
    1245
    895
    715
    etc..

    ?

    If so, try
    =INDEX(A1:J10,MATCH(M1,A1:A10,-1),MATCH(M2,A1:J1))

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Lookup Next Highest Number

    You'll need to replace each MATCH argument with something a bit more complex.

    First, it might be an exact match, then you don't want it to go to the next highest. Right? So we need to check for exact matches. Then we would use your formula (if there is no exact match) +1

    So the portion

    MATCH(M1,A1:A10) becomes

    IFERROR(MATCH(M1, A1:A10,0), MATCH(M1, A1:A10)+1)

    Make sense?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    09-17-2015
    Location
    Leicester
    MS-Off Ver
    2007
    Posts
    3

    Re: Lookup Next Highest Number

    Thanks for the replys.

    That seems to work Chemist B.

    How would I put this together for it to look at the height value in M1 and the width value in M2 and return the value in the table?

    I have tried figuring this out but with no success.

    Thanks in advance.

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Lookup Next Highest Number

    Okay, going back to your original formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    First of all, the INDEX should only include the datarange and not the top and side headers so I would think it would be

    =INDEX($B$2:$J$10, IFERROR(MATCH(M1, $A$2:$A$10,0), MATCH(M1, $A$2:$A$10)+1), IFERROR(MATCH(M2, $B$1:$J$1,0), MATCH(M2, $B$1:$J$1)+1))

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Lookup Next Highest Number

    Try this
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-17-2015
    Location
    Leicester
    MS-Off Ver
    2007
    Posts
    3

    Re: Lookup Next Highest Number

    Thanks,

    Both formulas worked perfect!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Return row number for highest date with given lookup value (no matrix please)
    By nielsb in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 07-21-2015, 11:06 PM
  2. [SOLVED] How2 find number in range and return that number or if doesn't exist then the next highest
    By Crawfinator1 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-06-2014, 08:52 AM
  3. Replies: 0
    Last Post: 09-06-2012, 10:41 AM
  4. Find highest number of sales in a date range and show seller and sale number
    By audiofreak in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-06-2012, 03:34 AM
  5. VBA code to find highest and 2nd highest number based in criteria
    By Michael007 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-25-2011, 08:38 AM
  6. Lookup the nth highest number in a row
    By errigal in forum Excel General
    Replies: 2
    Last Post: 09-29-2008, 04:18 PM
  7. Replies: 3
    Last Post: 08-10-2006, 11:40 PM

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