+ Reply to Thread
Results 1 to 10 of 10

get first higher number

  1. #1
    Forum Contributor
    Join Date
    10-11-2008
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    111

    get first higher number

    Hi,

    I need a function that can get, from a matrix, the first number that is higher than the number in a given cell.

    Is this possible?

    Thank you

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

    Re: get first higher number

    By matrix what do you mean, a single column or row or a range consisting of multiple row and columns? By "first" I presume you mean positionally on the worksheet

    If it's the former, e.g. A2:A100, you can use this formula where the given cell is C2

    =INDEX(A2:A100,MATCH(TRUE,INDEX(A2:A100>C2,0),0))

    If it's the latter then define "first"

  3. #3
    Forum Contributor
    Join Date
    10-11-2008
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: get first higher number

    sorry wasn't very clear..

    yes, by matrix I mean a range of cells consisting of multiple rows and columns

    by "first" I mean searching this range for the most approximate number but higher than the one specified.

    eg:

    i have the number 7.6

    from this range of numbers: 3.3;4.4;6.7;8.1;10.1;5.5;9.2

    i want the function to get me the number 8.1, which is the lowest number from the range that is higher than 7.6

    does this make sense?

  4. #4
    Registered User
    Join Date
    01-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    67

    Re: get first higher number

    Try:
    =MIN(IF(A1:A7>B1,A1:A7))
    confirmed with control+shift+enter

    where A1:A7 is the range of numbers and B1 is the reference number

  5. #5
    Forum Contributor
    Join Date
    10-11-2008
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: get first higher number

    error: #value

    the problem with this is working with ranges of cells and single cells at the same time..the formula you wrote returns a range of cells, not a single cell...

    tks anyway

  6. #6
    Registered User
    Join Date
    01-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    67

    Re: get first higher number

    Quote Originally Posted by Coaster View Post
    error: #value

    the problem with this is working with ranges of cells and single cells at the same time..the formula you wrote returns a range of cells, not a single cell...

    tks anyway
    can you post a sample workbook?

  7. #7
    Forum Contributor
    Join Date
    10-11-2008
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: get first higher number

    sure...here you go...
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    67

    Re: get first higher number

    Quote Originally Posted by Coaster View Post
    sure...here you go...
    Check the attached file.
    The formula needs to be confirmed with control+shift+enter and the array formula doesnt work in merged cells...so what I did is...unmerged the cells, inserted the formula and merged the cells back
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    10-11-2008
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: get first higher number

    works great now...tnks!

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: get first higher number

    Why not just use SMALL with COUNTIF ?

    J21: =SMALL(G8:R15,COUNTIF(G8:R15,"<="&$J$19)+1)

    (non-array)

+ 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