+ Reply to Thread
Results 1 to 10 of 10

Conditional formatting for character length

  1. #1
    Registered User
    Join Date
    03-04-2008
    Posts
    4

    Conditional formatting for character length

    Hi,

    I am working with a document that has a column that can only be 40 characters max when I upload it to the web. I would like to set it up so those cells highlight when it has more than 40 characters in it. I am constantly adding new items that come through and if it's greater than 40 characters, I'll need to manually revise them. So I'm not looking for something that will only allow 40 or cuts off after 40. I just want to be "notified" that it's too long.

    As far as I can tell, conditional formatting is only based on the value of the cell - please give me any insight to this.

    Thanks!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Use =LEN(A1) > 40 as the formula for conditional formatting.

  3. #3
    Registered User
    Join Date
    03-04-2008
    Posts
    4
    Thank you! How do I get it to apply to every cell in the column? There are 500+ cells and when I try to select them all and enter in the formula, it's not working. It only works for me when I do it cell by cell - and I'm sure there's an easier way!

    Thanks!

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Lets say you want to apply it to column C from C3 to C533. Highight from C3 to C533 and go to Format >Conditional Format and enter =LEN(C3)>40. That should do it.

    ChemistB

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Select the range of cells to include the format, and in the formula insert the cell reference of the topmost, leftmost cell, without any dollar signs.

  6. #6
    Registered User
    Join Date
    03-04-2008
    Posts
    4
    That's what I tried to do and it's not working. It highlights every single one (because the first cell happens to be >40.

    My spreadsheet is weird in that I have numbers as column and rows. When I insert the formula in a cell I have to enter it as =LEN(R2C3) > 40 (this is my first cell). This seems to be working when I do it to individual cells, but when I try to select the entire selection, it isn't taking.
    Last edited by shg; 03-04-2008 at 05:09 PM.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    If you're using R1C1 references (but why?), then the formula should be =LEN(RC) > 40

    Tools > Options > General, uncheck R1C1 reference style.

  8. #8
    Registered User
    Join Date
    03-04-2008
    Posts
    4
    That worked - thank you!!

    The spreadsheet is a template that I received from the company for uploading. It was designed that way - I'm guessing because it has to be that way to upload correctly??? I'm not even sure.

    Thanks for the help on this - this will be so much easier going forward!!

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    You're very welcome.

  10. #10
    Registered User
    Join Date
    04-19-2017
    Location
    Toronto, Canada
    MS-Off Ver
    2013
    Posts
    1

    Re: Conditional formatting for character length

    Quote Originally Posted by shg View Post
    If you're using R1C1 references (but why?), then the formula should be =LEN(RC) > 40

    Tools > Options > General, uncheck R1C1 reference style.
    I'd like to thank you for this answer, now 15 years in the future. I'm losing my mind trying to figure out why I am not getting this, and this gem of a comment is floating around out there.

    Thanks MS, for this goofy thing. Thanks shg, for the answer. And I use R1C1 because everything I do is in macros spread across thousands of duplicate sheets (so no named ranges for this guy).

+ 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