+ Reply to Thread
Results 1 to 4 of 4

Find the first lowest value in a column that exceeds $foo

Hybrid View

  1. #1
    bugmenot
    Guest

    Find the first lowest value in a column that exceeds $foo

    I've got a column with a list of ordered values like this:

    100000000 
    50000000 
    33333333 
    25000000 
    20000000 
    16666667 
    14285714 
    12500000 
    11111111 
    10000000 
    9090909 
    8333333 
    7692308 
    7142857 
    6666667 
    6250000 
    5882353 
    5555556 
    5263158 
    5000000 
    4761905 
    4545455 
    4347826 
    4166667
    And a user enters a value, which could be anything up to the highest value in this column. I need a method of finding the lowest number in the column that is larger than the user entered value.

    for example, if the user entered 4500000, then the value I'd need would be 4545455.

    Any ideas on how I can accomplish this?

    **Note: you'll notice that this list of numbers has a pattern. It is 1/N*100000000
    Last edited by bugmenot; 03-21-2009 at 08:52 PM. Reason: add formula

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

    Re: Find the first lowest value in a column that exceeds $foo

    Assuming your list is in A1:A24 and lookup value in C1 you can use this formula

    =INDEX(A1:A24,MATCH(C1,A1:A24,-1))

  3. #3
    bugmenot
    Guest

    Re: Find the first lowest value in a column that exceeds $foo

    Wow, that's easier than I had thought. I was trying arrays and all kinds of funky things.

    Thanks so much for the help, this works nicely!

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

    Re: Find the first lowest value in a column that exceeds $foo

    Given you particular list I suppose you could actually calculate without the table, i.e.

    =100000000/INT(100000000/C1)

    although you might want to set the minimum value.....

    In general you could also use an array formula to get the lowest number that's larger than C1, i.e.

    =MIN(IF(A1:A24>=C1,A1:A24))

    confirmed with CTRL+SHIFT+ENTER

+ 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