+ Reply to Thread
Results 1 to 8 of 8

Coloring a cell using LEN with Conditioning formating , but the number is an interval?

  1. #1
    Registered User
    Join Date
    04-18-2018
    Location
    London England
    MS-Off Ver
    Microsoft office professional plus 2010
    Posts
    9

    Coloring a cell using LEN with Conditioning formating , but the number is an interval?

    Hello,

    I have trouble finding the correct syntax/formula for coloring a cell based on the number of chars in a diff cell

    So i am using Conditional Formatting with the current rules:


    1. =LEN(C2) =0 this will leave the cell blank no color
    2. =LEN(C2) <= 27 - this will color the cell Green if the number is from 1 to 27
    3. =LEN(C2)>=28, LEN(C2)=40 - this should color the cell yellow if the number is between 28 and 40 ????
    4. =LEN(C2) > 40 is will color the cell red

    Now for the 3rd rule is the problem , i was looking around and i found ="AND LEN(C2)>=28, LEN(C2)=40" or with OR , or some other variation even AI put this formula , but it is not working at all , and i do not know how to color a cell with LEN that should count an interval between 2 numbers

    Thank you

  2. #2
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,309

    Re: Coloring a cell using LEN with Conditioning formating , but the number is an interval?

    Not logical. Try this:

    =AND(LEN(C2)>=28,LEN(C2)<=40)
    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.

  3. #3
    Registered User
    Join Date
    04-18-2018
    Location
    London England
    MS-Off Ver
    Microsoft office professional plus 2010
    Posts
    9

    Re: Coloring a cell using LEN with Conditioning formating , but the number is an interval?

    Hi, thank you , sadly it is not working , i have uploaded the xls for checking

    value_text.xlsx

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,357

    Re: Coloring a cell using LEN with Conditioning formating , but the number is an interval?

    A couple of things I notice:

    1) For some reason, the third =AND(...) rule (the one testing for string length between 28 and 40) had extra quotation marks in it, so that it was really just a text string and not a formula. I edited the rule formula to remove the extraneous quotation marks, and it seemed to work correctly.
    2) 0 is both equal to 0 and less than 28. Because conditional formatting evaluates rules in order from top to bottom, when length is 0, it will be formatted green like others that are less than 28. I checked the "stop if true" box next to this rule, so that conditional formatting will stop when length is 0 and not continue to evaluate the other conditions.

    Is that closer to what you are expecting it to do?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,309

    Re: Coloring a cell using LEN with Conditioning formating , but the number is an interval?

    It is now that I have removed the ".........""" that were surrounding it!
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-18-2018
    Location
    London England
    MS-Off Ver
    Microsoft office professional plus 2010
    Posts
    9

    Re: Coloring a cell using LEN with Conditioning formating , but the number is an interval?

    Hmm, that is strange since i could not do it without the quotes , as per this error

    issue.png

  7. #7
    Registered User
    Join Date
    04-18-2018
    Location
    London England
    MS-Off Ver
    Microsoft office professional plus 2010
    Posts
    9

    Re: Coloring a cell using LEN with Conditioning formating , but the number is an interval?

    thank you guys for the help , as always , much appreciated for your wonderful work and support

  8. #8
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,309

    Re: Coloring a cell using LEN with Conditioning formating , but the number is an interval?

    It's working in the attachment. Are we sorted now?

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

+ 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. coloring cells by conditional formating with fis
    By langeloo in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-27-2021, 03:43 PM
  2. [SOLVED] Auto-Identification of amount, in resp time interval column & coloring it, using VBA Macro
    By Ram_G in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-15-2014, 09:14 AM
  3. Replies: 1
    Last Post: 04-29-2014, 04:42 AM
  4. How to Mark a Cell with a specified Number of interval
    By kretos88 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-05-2013, 04:43 PM
  5. Auto-Coloring a Cell that Depends on the Number
    By loved07 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-23-2012, 04:47 PM
  6. [SOLVED] Conditional Formating, Coloring Each Row Based On Cell Value, 500+
    By bmsrmd in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-16-2012, 02:50 PM
  7. [SOLVED] Conditional formating-Is there a way to get the background coloring also?
    By glen.e.mettler@lmco.com in forum Excel General
    Replies: 2
    Last Post: 04-06-2006, 09:20 AM

Tags for this Thread

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