+ Reply to Thread
Results 1 to 5 of 5

Conditional formatting precedence question

  1. #1
    Registered User
    Join Date
    05-04-2018
    Location
    Hong Kong
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    69

    Conditional formatting precedence question

    Hi
    I have an issue with conditional formatting precedence.
    In cell C1758, I have an excel formula which returned - for this particular instance - “SF7”.
    I am trying to highlight the cell with conditional formatting depending on the last digit.
    So, with conditional formatting I use a formula with RIGHT and LEN function to extract the last digit ("7" in this particular instance) and compare it will specific values.

    The following conditional formatting is done with cell C1758, in order of precedence:

    1) Formula: = RIGHT (C1758,LEN(C1758)-2)>13 Format red color
    2) Formula: = RIGHT (C1758,LEN(C1758)-2)>9 Format orange color
    3) Formula: = RIGHT (C1758,LEN(C1758)-2)>0 Format yellow color

    Because in this particular instance, the formula in cell C1758 returns “SF7”, the last digit “7” cannot fulfill conditions (1) and (2), therefore the conditional formatting should highlight the cell in yellow color.
    However, for some reason not understandable to me, the cell was highlighted in red color.

    Any advice on what could be the problem.
    I am enclosing a snapshot of the conditional formatting for reference.
    Attached Images Attached Images

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Conditional formatting precedence question

    Please try
    =--RIGHT (C1758,LEN(C1758)-2)>13

    Right() is text and text alway more than number, --Right() change text to number

  3. #3
    Registered User
    Join Date
    05-04-2018
    Location
    Hong Kong
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    69

    Re: Conditional formatting precedence question

    Thank you !!
    It seems to work well.
    For my learning purpose, may I ask what do the "--" before RIGHT function do?

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Conditional formatting precedence question

    -- change text to number value

    =--Right("SF7") =--"7" =7

  5. #5
    Registered User
    Join Date
    05-04-2018
    Location
    Hong Kong
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    69

    Re: Conditional formatting precedence question

    Thanks again Sir!

+ 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. [SOLVED] Conditional formatting and precedence rules
    By KClem in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-25-2015, 02:42 PM
  2. [SOLVED] Conditional formatting question
    By weaverswonders6 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-24-2014, 04:25 PM
  3. Conditional Formatting Question
    By andyb16 in forum Excel General
    Replies: 1
    Last Post: 08-22-2012, 05:07 AM
  4. Forcing calculation precedence question
    By logical_american in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-02-2012, 12:43 AM
  5. Conditional Formatting question
    By hawkeye13 in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 06-23-2011, 04:35 PM
  6. question re conditional formatting
    By 007juk in forum Excel General
    Replies: 1
    Last Post: 07-25-2007, 07:59 PM
  7. Conditional formatting question
    By Carl Imthurn in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 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