+ Reply to Thread
Results 1 to 7 of 7

Finding the closest number on a column

  1. #1
    Registered User
    Join Date
    06-18-2007
    Posts
    4

    Finding the closest number on a column

    I have not been able to find the correct formula to find the closest number(higher or lower) from a column with diferent values. I have only found formulas for finding a value Higher or formulas for finding a value lower, but i need excel to find the closest (higher or lower). Thanks for the help in advance.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    If you have a number in B1 and you want to find the nearest number to that in A1:A10 (higher or lower) then try this formula

    =INDEX(A1:A10,MATCH(MIN(ABS(B1-A1:A10)),ABS(B1-A1:A10),0))

    confirmed with CTRL+SHIFT+ENTER

  3. #3
    Registered User
    Join Date
    06-18-2007
    Posts
    4
    Quote Originally Posted by daddylonglegs
    If you have a number in B1 and you want to find the nearest number to that in A1:A10 (higher or lower) then try this formula

    =INDEX(A1:A10,MATCH(MIN(ABS(B1-A1:A10)),ABS(B1-A1:A10),0))

    confirmed with CTRL+SHIFT+ENTER
    This worked great, thanks daddylonglegs. I wanted to work with this on my Pocketpc that has windows mobile 5 with excel but when I transfer the file, the array disapears, when I try to redo it on the pocketpc it does not work. Is there a work around? Anyway Thanks

  4. #4
    Registered User
    Join Date
    06-18-2007
    Posts
    4
    Quote Originally Posted by daddylonglegs
    If you have a number in B1 and you want to find the nearest number to that in A1:A10 (higher or lower) then try this formula

    =INDEX(A1:A10,MATCH(MIN(ABS(B1-A1:A10)),ABS(B1-A1:A10),0))

    confirmed with CTRL+SHIFT+ENTER
    Is there any way of doing this without it being an array?

  5. #5
    Registered User
    Join Date
    06-18-2007
    Posts
    4
    Anyone????

  6. #6
    Registered User
    Join Date
    12-06-2006
    Location
    Seattle, WA
    Posts
    6
    I'm trying to find the number closest to 50% in the same column then conditionally format that cell...any help?

  7. #7
    Forum Contributor
    Join Date
    07-05-2007
    Location
    Lexington, MA
    Posts
    302

    Identify the value in a list that is closest to the target

    Here is an approach using worksheet functions and no array formulas
    The attached workbook also uses conditional formatting to highlight the closest value.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by FrankBoston; 08-25-2007 at 03:43 PM.
    FrankBoston is the pen name for Andrew Garland, Lexington MA

+ 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