Results 1 to 7 of 7

Highlighting numbers with corresponding negatives. (Tut - Please add to it)

Threaded View

  1. #1
    Registered User
    Join Date
    04-28-2016
    Location
    Islamabad, Pakistan
    MS-Off Ver
    2007 , 2010 , 2013
    Posts
    5

    Post Highlighting numbers with corresponding negatives. (Tut - Please add to it)

    Hi everyone. Just a quick how-to on the subject. Im no expert, just sharing my two cents so it might help somebody out. If you have a better way of doing this, by all means,
    please link below.

    Now, I work in accounting, so sometimes I need to find out if there are any numbers in my data that net to Zero (mostly these are reversals that I do not need in my sheets).

    So here, we have an example set of data with negatives and positives; that I created for who knows what reason. (You can download it below)


    Now, what we want is to highlight the numbers that have a net value of Zero.

    (1) Select your values:


    Name:  2.jpg
Views: 218
Size:  281.5 KB

    (2) Go to conditional formatting under Home, and select "New Rule":


    Name:  3.jpg
Views: 138
Size:  282.9 KB

    (3) Select Formula and Type in the formula that follows, and select what you'd like to do with it. I merely wanted it to highlight the cells in question to red:

    Name:  4.jpg
Views: 149
Size:  209.7 KB

    =COUNTIF($F$4:$F$14,-1*F4)=1
    (4) Press OK Twice (i.e. once on both windows) and the cells that net to zero should take on the formatting you desired:

    Name:  5.jpg
Views: 213
Size:  273.4 KB

    FORMULA ANALYSIS

    The Function

    =COUNTIF
    We have used the COUNTIF function. This is one of excel's statistical functions and it will count the number of cells based on criteria that you specify.

    The First argument

    ($F$4:$F$14,
    This part of our formula tells excel to look in a strictly limited range. You could, however change the range to "F:F" and excel will then look in the entire F range.

    The Middle argument

    ,-1*F4)
    This part of our formula will multiply -1 with the value in the specified cell, i.e F4. (The last part is incremented to go with the corresponding cell i.e F5, F6, F7 etc). This is done to match ABSOLUTE (For example, if you have 30 and -30.4, these values will NOT be selected) opposites.

    The Ending argument

    =1
    This part of the formula will help us format duplicate values / returning "TRUE". The opposite (=0) would format values that arent duplicates / return "FALSE"

    Additional Information

    Forum Guru TMS has pointed out the following:

    if you have two positive values and one negative, for example, 117, 117, -117, it won't highlight the negative number. And,if you have two or more matching pairs, it won't highlight any of the values.
    So you might want to keep that in mind.

    -----------------------

    Thats about it. I do understand that this is not exhaustive, but it gets the job done. If anyone has better explanations for what the different arguments in the formula do, please post them below and I will append them with credit to you.

    Cheers.
    Attached Files Attached Files
    Last edited by techypk; 05-27-2016 at 12:15 AM. Reason: Additional information added.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 10
    Last Post: 03-16-2025, 01:59 AM
  2. [SOLVED] Highlighting numbers that appear more than 3 times
    By Spotniq in forum Excel General
    Replies: 9
    Last Post: 01-15-2020, 03:52 AM
  3. [SOLVED] Help with HLOOKUP or SUMIF? to separate negatives or numbers with a - symbol and add them
    By DFaulstich in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-29-2015, 03:59 PM
  4. Trouble highlighting only four lowest numbers in a row
    By tankmccuin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-19-2014, 08:47 PM
  5. Trying to add a column of numbers, but ignoring negatives
    By Lord Waste in forum Excel General
    Replies: 5
    Last Post: 04-07-2009, 06:43 AM
  6. automatically highlighting numbers 0 and 1
    By lau260x in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2008, 03:52 PM
  7. [SOLVED] making columns automatically turn numbers into negatives
    By Kathy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-01-2005, 02:06 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