+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    10-10-2007
    Posts
    2

    Question Same question but with a < character

    I want to do a very similar action, but I need to format a cell that may contain a "<" character. Specifically, I want to compare D7, which may be <1.00, or 5.00, or 21000, to C6, which is always a specific number. I need to format D7 to be bold red text if it is greater than C6.

    The problem occurs because of the "<" character that is sometimes in D7.

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,142
    I want to do a very similar action, but I need to format a cell that may contain a "<" character. Specifically, I want to compare D7, which may be <1.00, or 5.00, or 21000, to C6, which is always a specific number. I need to format D7 to be bold red text if it is greater than C6.

    The problem occurs because of the "<" character that is sometimes in D7.
    Select D7 and active the Conditional Format dialogue...

    Select Formula is and enter formula: =IF(ISNUMBER(D7),D7,MID(D7,2,255)+0)>C6

    Click Format and choose your font attributes....

    Click Ok.

    Click oK again to finish.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    10-10-2007
    Posts
    2

    Thank you so much!

    I'm going to have to study the formula to figure out what it's doing, but it works! Thanks very very much!

  4. #4
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,142
    No problem!

    The formula is first checking to see if D7 is a number (ie. no funny chars, etc included)...if so it compares D7 with C6, otherwise it compares the part of D7 after the 1st character with C6. Note: The +0 coerces the string (which is currently considered text) to a number so it can compare against number in C6.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #5
    Forum Guru VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    12,009
    waymegelli,

    Please read forum rules below. You should always start a new thread if you have a question. I've moved it for you this time

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

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.2.0