+ Reply to Thread
Results 1 to 2 of 2

Find the two closest values in a list (bigger and smaller)

  1. #1
    Registered User
    Join Date
    04-09-2014
    Location
    Norway
    MS-Off Ver
    Excel 2010
    Posts
    1

    Find the two closest values in a list (bigger and smaller)

    Hi,

    I have a list with random ordered numbers (each number in a cell of a row):
    1, 2, 6, 8, 11, 12, 16...

    On the other hand I get a value (x). I want a formula that:
    - If x is in the list, returns x
    - If x is not in the list, returns the next higher value. For example, if x=8, returns 11

    I want also a variation of the same formula, that returns the next lower value. For example, if x=8, returns 6.

    Note that x will never be smaller than the first number on the list or higher than the highest number in the list.

    Can you help me with that?

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Find the two closest values in a list (bigger and smaller)

    use array formula (Ctrl+Shift+Enter comitted)
    Please Login or Register  to view this content.
    (data in row 1 , value to be checked in A2)
    similar (but MAX and >) for the second case
    Best Regards,

    Kaper

+ 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] 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
  2. Replies: 20
    Last Post: 08-02-2012, 10:48 AM
  3. changing color of values bigger or smaller than target
    By Fedde in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 03-27-2006, 08:28 AM
  4. Replies: 0
    Last Post: 08-25-2005, 02:37 AM
  5. How to find value that is bigger or smaller than 2SD?
    By learner in forum Excel General
    Replies: 8
    Last Post: 05-11-2005, 05:06 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