+ Reply to Thread
Results 1 to 13 of 13

Conditional formatting not working as expected

  1. #1
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    314

    Conditional formatting not working as expected

    I've set conditional formatting to color cells containing a specific value. I select "Highlight Cell Rules" then "Equal value" then set value to 1. Some of the cells with value "1" get the highlighting but some do not. I've applied the rule to cells $A$16:$Z$21 - there are 9 occurrences in the range with a value of 1, however only 6 of them are highlighted. I have attached the workbook.

    Thanks for any help.
    Attached Files Attached Files

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Conditional formatting not working as expected

    Some of the values are text, not numbers. The text "1" is not the same as the number 1.

    If you don't see the green warning triangles in some of the cells, click File > Options > Formulas and in the section for Error Checking Rules, tick the box for "Numbers formatted as text or preceded by an apostrophe"

    Now you will see all number stored as text marked with a green triangle and you can fix the problem.

  3. #3
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Conditional formatting not working as expected

    may be your enteries are pretended as TEXT
    go to conditional formatting and use custom formula as =(A16+0)=1 then select the range you want to apply CF. click ok
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Conditional formatting not working as expected

    Quote Originally Posted by hemesh View Post
    go to conditional formatting and use custom formula as =(A16+0)=1 then select the range you want to apply CF. click ok
    That will fix the symptom, but not the cause. The problem still exists. It's better to fix the underlying cause, so it cannot create more symptoms.

  5. #5
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Conditional formatting not working as expected

    Agreed teylyn

  6. #6
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Conditional formatting not working as expected

    Hello teylyn, thanks for your quick response, however when I select the cell and select "Home" on the ribbon then in the number tab I select "Number" but it doesn't change and the green triangle still appears in the cells?

  7. #7
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Conditional formatting not working as expected

    Thanks Hemesh, I will try that if all else fails - teylyn recommends changing the cells format to "Number" or "General" but I'm having a problem still.

  8. #8
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    2,002

    Re: Conditional formatting not working as expected

    It doesn't work because some numbers are stored as texts.
    Attached Files Attached Files

  9. #9
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Conditional formatting not working as expected

    Quote Originally Posted by pongmeister View Post
    Thanks Hemesh, I will try that if all else fails - teylyn recommends changing the cells format to "Number" or "General" but I'm having a problem still.
    Changing the cell format will not change the underlying value. If the number is stored as text, it needs to be re-entered as a number. Format is just decoration. Value is king.

  10. #10
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Conditional formatting not working as expected

    Hi CARACALLA,

    I've tried changing some cells with the green triangle to "Number" and when I check after by highlighting one of the cells and selecting "Home" on menu the "Number" in sub-menu it shows it as a "Number" - but the green triangle is still there and the cell is not selected under the conditional format I'm using.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,292

    Re: Conditional formatting not working as expected

    Do you have a sample workbook showing the issue?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  12. #12
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Conditional formatting not working as expected

    teylyn,

    That was the key, I didn't realize that was necessary, I re-typed them and it works perfectly.

    Thanks so much for the help! I will close this post now

  13. #13
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Conditional formatting not working as expected

    Yes, I attached it to the post, however the issue is resolved. Some of the cells were text and I had to change them to "Number" and re-type them to set the underlying value correctly (Per teylyn). thanks

+ 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. Conditional Formatting not working as expected
    By pongmeister in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-15-2019, 07:54 PM
  2. conditional format query not working as expected
    By max8719 in forum Excel General
    Replies: 4
    Last Post: 12-16-2018, 11:24 AM
  3. Replies: 4
    Last Post: 06-21-2017, 10:33 AM
  4. [SOLVED] Conditional Format not working as expected
    By scudo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-10-2015, 10:44 AM
  5. [SOLVED] Not getting the expected results from conditional formatting
    By thoughtreactor in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-08-2015, 12:58 PM
  6. [SOLVED] Conditional formatting not working as expected
    By SEMMatt in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-25-2014, 09:53 PM
  7. [SOLVED] Conditional formating of tab colours not working as expected
    By derekps98 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-02-2013, 04:06 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