+ Reply to Thread
Results 1 to 7 of 7

Character Count in a 'cell' based on a Letter

  1. #1
    Registered User
    Join Date
    05-23-2014
    Posts
    6

    Character Count in a 'cell' based on a Letter

    I need to create 2 functions in the same column, they are;

    Product numbers: Characters greater than 12 = Bold/Red Font
    Product numbers: Characters starting with the letter 'K' and is greater than 16 = Highlighted Cell

    Purpose: Product numbers are entered into a database with these requirements

    I understand Conditional formatting and the LEN function but I am unable to apply both functions using either successfully? Is this reasonable request in Excel?

    Tlazio

  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

    Re: Character Count in a 'cell' based on a Letter

    Give some examples.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    05-23-2014
    Posts
    6

    Re: Character Count in a 'cell' based on a Letter

    All Product numbers MUST remain in the same column.

    Product numbers beginning with the letter 'K' (or K0) may contain up to, but no more than, 16 characters.
    All other Product numbers can contain up to, but no more than, 12 characters.

    TP21-1/0 (8 char. okay)
    HLP322MTS-20 (12 char. okay)
    HLP322MTSL-20 (13 char. not allowed)

    K0TPCABLE-3-24 (14 char. okay)
    K0TPCALABEL-3-24 (16 char. okay)
    K0TPCALABELS-3-24 (17 char. not allowed)

    Hope this helps.

    Tlazio

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

    Re: Character Count in a 'cell' based on a Letter

    A
    B
    C
    1
    TP21-1/0
    1
    B1: =(LEFT(A1) = "K") * (LEN(A1) <= 16) + (LEN(A1) <= 12)
    2
    HLP322MTS-20
    1
    3
    HLP322MTSL-20
    0
    4
    K0TPCABLE-3-24
    1
    5
    K0TPCALABEL-3-24
    1
    6
    K0TPCALABELS-3-24
    0


    Use the formula shown for data validation.

  5. #5
    Registered User
    Join Date
    05-23-2014
    Posts
    6

    Re: Character Count in a 'cell' based on a Letter

    Thank you shg!

    Although this works fine, the workbook should not contain another column as listed above. Also, the cells are compiled by other users and they need to see when the data does not fit the criteria so that it can be corrected prior to moving it on. So, what I'm looking for in this formula is to highlight the cells that contain more than the allotted characters for each scenario. Can this be done without adding another column?

    Tlazio

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

    Re: Character Count in a 'cell' based on a Letter

    Can you not adapt the formula shown for conditional formatting?

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Character Count in a 'cell' based on a Letter

    Or try this ...

    =LEN(A1)<17-4*(LEFT(A1)<>"K")

+ 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] Macro to rename cell content based on the starting character until found same character
    By oeyandyprawira in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-19-2015, 09:36 AM
  2. How do I cut/paste part of a cell, based on character count?
    By jweasl in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-21-2014, 11:24 AM
  3. [SOLVED] Break Cell based on character count-w/o splitting words-Help
    By mnfez in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-19-2013, 09:05 AM
  4. [SOLVED] Inserting a cell and shifting right if the first character is a letter
    By DannyJ in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-06-2013, 09:55 AM
  5. Recognize if the first character in a cell is a letter or a number
    By b00kjo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-10-2013, 04:35 PM
  6. Display Active Character Count + Limit Character Per Cell
    By euronail in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2011, 04:59 AM
  7. Replies: 1
    Last Post: 07-16-2010, 12:25 PM

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