+ Reply to Thread
Results 1 to 3 of 3

Conditional Formating with Right function

  1. #1
    Registered User
    Join Date
    04-11-2010
    Location
    Denial
    MS-Off Ver
    Excel 2003
    Posts
    1

    Smile Conditional Formating with Right function

    Howdy !

    First time poster here, hopefully not last. I am a 5th Grade tutor and trying to help out one of my teachers with a spreadsheet she keeps by hand.

    I have data in a cell "10-8-09 128" and I am trying to have a conditional format set so that if the last three numbers are below for example 104, the cell turns red. I have the red part all set up in the styles and formatting, but for the life of me can not figure out how to have the flipping cell get evaluated by using a function.

    Any ideas ?

    BW

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Conditional Formating with Right function

    Assuming the range of cells to apply this to are B1:B50...

    1) Highlight B1:B50
    2) Go to Format > Conditional Formatting
    3) Use these settings:

    Condition1: Formula Is: =(RIGHT(B1,3)+0)<104
    Format...Patterns: Red



    The thing to remember is that the functions LEFT, RIGHT and MID are text functions, they return a text answer, even if the string is numerical, Excel doesn't know that. So, adding 0 to the string converts it back to a number and Excel can then do a value comparison.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

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

    Re: Conditional Formating with Right function

    Assuming the final value could be other than 3 digits in length an alternative might be:

    =(REPLACE(B1,1,FIND(" ",B1&" "),"")+0)<104

    EDIT: re-reading the OP it seems the above is either not likely or not a requirement so apologies if above has caused confusion
    Last edited by DonkeyOte; 04-12-2010 at 02:53 AM.

+ 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