+ Reply to Thread
Results 1 to 5 of 5

find number closest to 0 (positive or negative)

  1. #1
    Registered User
    Join Date
    11-26-2021
    Location
    Netherlands
    MS-Off Ver
    365 version 2110
    Posts
    1

    find number closest to 0 (positive or negative)

    i have a row of digits of positive and negative numbers.
    in this row i want to highlight the number closest to 0.

    we have made guesses of multiple outcomes and for each outcome i would like to highlight the closest number so we could see in an instand who's guessis the closest per line.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: find number closest to 0 (positive or negative)

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: find number closest to 0 (positive or negative)

    I would probably add a helper row =ABS(A1) (assuming your values are in row 1) in an adjacent row. Then =MIN(helper row) to find the value closes to 0. Then a lookup function (probably MATCH()) to find the position of the minimum value, then whatever is needed to associate position with the person who made the guess.

    Step 1: helper row =ABS(A1)
    Step 2: get minimum =MIN(helper row)
    Step 3: find the position of the minimum =MATCH(result of 2,helper row,0)

    Will that work?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,911

    Re: find number closest to 0 (positive or negative)

    Try this:

    =INDEX($B2:$G2,MATCH(AGGREGATE(15,6,ABS($B2:$G2)/($B2:$G2<>0),1),ABS($B2:$G2),0))

  5. #5
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: find number closest to 0 (positive or negative)

    If your numbers are in cells A1 through J1, in Conditional formatting, try:

    =MIN(ABS($A$1:$J$1))=ABS(A1)

+ 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] Find the first date of the negative number closest to zero is ?
    By wk9128 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-17-2020, 10:48 PM
  2. Replies: 3
    Last Post: 08-13-2017, 04:55 PM
  3. [SOLVED] Re-assigning Zero and Negative values to closest positive value
    By TPower1 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-07-2017, 01:05 AM
  4. [SOLVED] Find pattern (positive, negative, positive)
    By tsakta13ole in forum Excel General
    Replies: 6
    Last Post: 06-01-2016, 05:10 AM
  5. Replies: 4
    Last Post: 06-14-2012, 06:53 AM
  6. VLOOKUP to find closest match - positive OR negative
    By eurobass in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-10-2009, 11:01 PM
  7. Replies: 2
    Last Post: 11-13-2008, 12:35 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