+ Reply to Thread
Results 1 to 5 of 5

Conditional formatting with < symbol

  1. #1
    Registered User
    Join Date
    04-25-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    9

    Conditional formatting with < symbol

    Hi All,
    I'm using a formula in conditional formatting to highlight cells values compared to a standard i.e. greater than or equal to or less than.
    Most values will be straight numbers but others will be entered with a < symbol leading the number. The formatting I'm using is simple red green (red bad green good). The problem is when I enter a value with a < symbol the cell turns red.
    All help greatfully accepted. Example attached.
    Thank you.
    Attached Files Attached Files
    Last edited by blaxal; 02-12-2010 at 08:46 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Conditional formatting with < symbol

    You could modify your CF formula such that:

    =--REPLACE(IF(ISNUMBER(A3)," "&A3,A3),1,1,"")>=$A$2
    format as red

    =--REPLACE(IF(ISNUMBER(A3)," "&A3,A3),1,1,"")<$A$2
    format as green

    EDIT: the above wouldn't work for <= and >= ... edit:edit - see below...
    Last edited by DonkeyOte; 02-12-2010 at 08:04 AM.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Conditional formatting with < symbol

    ....Or this for green

    =SUBSTITUTE(SUBSTITUTE(A3,">",""),"<","")+0<$A$2

    similar for red except the last < becomes >=

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Conditional formatting with < symbol

    Just for sake of my sanity...

    =--REPLACE(REPT(" ",(MID($A3,2,1)<>"=")+ISNUMBER($A3))&$A3,1,2,"")>=$A$2
    format red

    =--REPLACE(REPT(" ",(MID($A3,2,1)<>"=")+ISNUMBER($A3))&$A3,1,2,"")<$A$2
    format green


    should work for >, <, >=, <=, =

  5. #5
    Registered User
    Join Date
    04-25-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Conditional formatting with < symbol

    Thanks guys, worked a charm, very much appreciated.

+ 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