+ Reply to Thread
Results 1 to 11 of 11

Find Match or Next Lowest Number In Descending Column of Numbers

  1. #1
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Find Match or Next Lowest Number In Descending Column of Numbers

    Usually I can figure these things out for myself, but I guess I've had too much coffee today, I can't think straight.

    I have descending numbers. Just assume they start in A1
    284.0
    283.6
    282.8
    282.2
    281.5
    281
    280.8

    etc.

    Assume the number I want to search for is 281.8. I want the row number for either that number, or if not found give me the next lowest number, which in this case would be 281.5.

    Thanks for your help.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Find Match or Next Lowest Number In Descending Column of Numbers

    Let's go with:

    =MATCH(281.8,A1:A7,-1)+1

    OR

    =SUMPRODUCT(--(A1:A7<281.8))
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Find Match or Next Lowest Number In Descending Column of Numbers

    Hi,
    Assuming like you said that the numbers are in descending order, starting in A1 and that the number to find is in B1, this should work :

    Please Login or Register  to view this content.
    If you want to return the value instead of the row number then :
    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Find Match or Next Lowest Number In Descending Column of Numbers

    =countif(a1:a7,">" &281.8)+1

  5. #5
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Find Match or Next Lowest Number In Descending Column of Numbers

    Here's a simpler formula to return the value (not the row number):
    Please Login or Register  to view this content.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Find Match or Next Lowest Number In Descending Column of Numbers

    Hi Sky,

    Something like this?

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  7. #7
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Find Match or Next Lowest Number In Descending Column of Numbers

    Quote Originally Posted by daffodil11 View Post
    =countif(a1:a7,">" &281.8)+1
    So the data might not start in A1 there may be some blank rows above it.
    Your formula above gave me an idea and this is what I came up with and it seems to work.
    With the data going from A4:A10 and the number I want to look for in D4 this formula here seems to give me the desired results.
    Thanks for your help.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Find Match or Next Lowest Number In Descending Column of Numbers

    Quote Originally Posted by xladept View Post
    Hi Sky,

    Something like this?

    Please Login or Register  to view this content.
    I will definitely take a look at this as what I am doing is ultimately going to be in VBA. I didn't want to loop through a bunch of cells, I was hoping to use Evaluate and get a row number very quickly. I'm trying to find alternatives to looping.

    Thanks again.

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Find Match or Next Lowest Number In Descending Column of Numbers

    You're welcome and thanks for the rep!

    You're thinking of using enumerate - I'll be interested to see how that goes

  10. #10
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Find Match or Next Lowest Number In Descending Column of Numbers

    Quote Originally Posted by xladept View Post
    You're welcome and thanks for the rep!

    You're thinking of using enumerate - I'll be interested to see how that goes
    No I thought I would use Evaluate, but I just ended up doing this.

    Please Login or Register  to view this content.

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Find Match or Next Lowest Number In Descending Column of Numbers

    Does that work?

+ 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. Replies: 5
    Last Post: 02-13-2014, 05:37 PM
  2. [SOLVED] Re: Find lowest 5 numbers in column A with highest values in column B
    By jd16 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-05-2013, 02:08 AM
  3. Replies: 4
    Last Post: 10-06-2013, 10:40 AM
  4. Find lowest 5 numbers in column A with highest values in column B
    By dmccoy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-06-2013, 09:22 AM
  5. Find Lowest Time, Match with Column Heading
    By nadler1744 in forum Excel General
    Replies: 1
    Last Post: 07-08-2009, 01:17 AM

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