+ Reply to Thread
Results 1 to 3 of 3

How to treat "-" as 0 in conditional formating.

  1. #1
    Registered User
    Join Date
    06-20-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    6

    How to treat "-" as 0 in conditional formating.

    Hello,

    I have created a conditional format that compares the previous cell to see if it is higher (green) or lower (red) or equal (Yellow).

    I am having an issue where the previous cell is a "-" and the following cell is higher. It marks it as red instead of green.

    How can i set only the conditional formatting to recognize "-" as 0.

    I do not want to edit the main formulas because "-" is nullified and is not included in any calculations. Only wish to have Conditional formating recognize "-" as a 0


    See picture attached

    excel CF.JPG


    Thanks!

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: How to treat "-" as 0 in conditional formating.

    Perhaps add a CF like =Type(a1)>type(b1) and format green (the type for text is 2, for a number it's 1)
    ( you'll have to play around to adapt to your sheet, a picture is useless)

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: How to treat "-" as 0 in conditional formating.

    I suspect that the "-" simply means the cell is blank rather than zero. You therefore need an OR condition something like
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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: 6
    Last Post: 12-31-2013, 07:51 AM
  2. Conditional formating-format the cell background "Red".
    By Unplugged in forum Excel General
    Replies: 9
    Last Post: 07-25-2006, 01:16 PM
  3. Replies: 4
    Last Post: 06-13-2006, 07:25 PM
  4. [SOLVED] Conditional formating on text starts with "tot"
    By Mr. Smith in forum Excel General
    Replies: 2
    Last Post: 09-14-2005, 09:05 AM
  5. Cell color: "Conditional Formating"
    By Rafael in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-11-2005, 01:05 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