+ Reply to Thread
Results 1 to 3 of 3

Highlight positive and negative numbers based on data from another column

  1. #1
    Registered User
    Join Date
    06-02-2011
    Location
    Mauritius
    MS-Off Ver
    Excel 2010
    Posts
    16

    Highlight positive and negative numbers based on data from another column

    Abc 500
    abc -500
    bbb 300
    bbb 250
    cac 100
    cac -100
    ddd 200
    ddd 300
    fff -500

    I want to be able to highlight data in column B where amount is identical (ignore negative sign) only where data in column A is identical.

    In this particular case it should highlight 500,-500 where data in column A = ABC & also 100,-100 where data in column A =CAC.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,440

    Re: Highlight positive and negative numbers based on data from another column

    Hi,

    Assuming your data is in A1:B9, enter the following in C1

    =SUMPRODUCT(($A$1:$A$9=A1)*($B$1:$B$9=-B1))

    and copy down to C9

    A result of 1 indicates a match.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Highlight positive and negative numbers based on data from another column

    id go for
    =SUMPRODUCT(($A$1:$A$9=$A1)*(ABS($B$1:$B$9)=ABS($B1)))>1
    which you can use as a formula rule in conditional formatting
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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. Replies: 2
    Last Post: 11-21-2012, 07:27 AM
  2. Convert negative to positive in sheet containing both positive/negative numbers
    By sa02000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2010, 07:52 PM
  3. Replies: 3
    Last Post: 12-17-2009, 09:14 AM
  4. Replies: 2
    Last Post: 09-28-2005, 12:05 PM
  5. How to turn positive numbers in a column to negative numbers ?
    By Dbase Beginner in forum Excel General
    Replies: 1
    Last Post: 03-30-2005, 03:14 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