+ Reply to Thread
Results 1 to 10 of 10

Retrieving the Closest Larger / Closest Smaller Values from a List

  1. #1
    Forum Contributor
    Join Date
    09-21-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    131

    Retrieving the Closest Larger / Closest Smaller Values from a List

    Hello all,

    I was looking for an option how do I retrieve the closest smaller number from a list and have come across to this article.
    https://www.exceltip.com/lookup-form...act-match.html

    The function works well on on the file downloaded but if I insert my numbers (7digits long) into the list the function does not return the smaller number but the same exact number.

    Ideally I would need function to match two columns instead of just one.

    closest smaller number.PNG

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Retrieving the Closest Larger / Closest Smaller Values from a List

    Hi,

    please refer to the attachment. I'm using AGGREGATE

    In E2 a kind of SMALL(IF...

    =AGGREGATE(14,6,B2:B11/(B2:B11<=D$2),1)

    in F2 a kind of LARGE(IF...

    =AGGREGATE(15,6,B2:B11/(B2:B11>=D$2),1)

    Formulae do not need control+shift+enter.

    Regards
    Last edited by canapone; 03-31-2017 at 08:16 AM.
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Retrieving the Closest Larger / Closest Smaller Values from a List

    3200 doesn't exist in column so formula show closest value
    4843017 exist so why it should show another value?
    change 4843017 to 4843016 and you will see

  4. #4
    Forum Contributor
    Join Date
    09-21-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    131

    Re: Retrieving the Closest Larger / Closest Smaller Values from a List

    I don't understand, my file is still not returning right values but instead same number.

    closest smaller number2.PNG

  5. #5
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Retrieving the Closest Larger / Closest Smaller Values from a List

    Hi again,

    Sorry a typo. Formulae do not need "=" when compare numbers

    =AGGREGATE(14,6,B2:B11/(B2:B11<D$2),1)

    =AGGREGATE(15,6,B2:B11/(B2:B11>D$2),1)


    Regards

  6. #6
    Forum Contributor
    Join Date
    09-21-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    131

    Re: Retrieving the Closest Larger / Closest Smaller Values from a List

    Quote Originally Posted by sandy666 View Post
    3200 doesn't exist in column so formula show closest value
    4843017 exist so why it should show another value?
    change 4843017 to 4843016 and you will see
    Ahhh... I got it now. But what if I want to return the closest smaller value to the value im looking up even if the same number is present in the list?

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Retrieving the Closest Larger / Closest Smaller Values from a List

    Change +1 to +0

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Retrieving the Closest Larger / Closest Smaller Values from a List

    If the basic problem is solved
    - it's always a good practice to show respect to the person(s) who have helped you
    - is a click on the Add Reputation first (left lower corner of the post of person(s) who helped you)

    Thanks

  9. #9
    Forum Contributor
    Join Date
    09-21-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    131

    Re: Retrieving the Closest Larger / Closest Smaller Values from a List

    User canapone was the first one who answered my question so I have awarded him with reputation. Thank you for your understanding.

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Retrieving the Closest Larger / Closest Smaller Values from a List

    Of course Like I said:
    Quote Originally Posted by sandy666 View Post
    ...to show respect to the person(s) who have helped you

+ 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. Removing a smaller list from a larger one
    By juppy52 in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 03-09-2017, 04:56 PM
  2. finding the closest smaller and larger values in a list
    By bachree in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-28-2014, 02:42 PM
  3. Replies: 1
    Last Post: 04-09-2014, 12:30 PM
  4. Closest Angle instead of closest Value
    By stockgoblin42 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-19-2013, 05:06 PM
  5. [SOLVED] get 10 Closest Larger / Closest Smaller Values from a List
    By Auni in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-19-2013, 04:07 AM
  6. Displaying larger values with smaller values in a Column Chart
    By Max9 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 06-20-2010, 11:59 PM
  7. Replies: 0
    Last Post: 08-25-2005, 02:37 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