+ Reply to Thread
Results 1 to 2 of 2

Need formula for character limit based on Width of W

  1. #1
    Registered User
    Join Date
    02-16-2016
    Location
    Iowa, USA
    MS-Off Ver
    2010
    Posts
    1

    Need formula for character limit based on Width of W

    I have text in one column (Column B) that cannot exceed a certain limit (numeric value in Column C). This limit varies, depending on the row. The character limit is based on Arial font, Size 10, capital letter 'W'.

    Example: "Brown Dog" cannot exceed the length of 5 W's. Until I find some kind of formula, I have to manually check:
    Brown Dog
    WWWWW

    This text is too long. I need to remove 1 character, so it says 'Brown Do'.

    "Pickle" cannot exceed the length of 3 W's.
    Pickle
    WWW
    This is acceptable.

    I'm using PC Excel 2010.

    Suggestions please?

  2. #2
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,394

    Re: Need formula for character limit based on Width of W

    Mindy,

    You can set the cell limit by Data Validation, which will give you an error message if the text exceeds whatever character limit you set, but you then have to retype it omitting letters, as in your example

    It can be done automatically if you can accept a "helper" column, because you set that to show the "trimmed" text that does fit your criteria.

    Example:
    Assume "Brown Dog" is in B1, and C1 sets the character limit.

    Type into D1 "=LEFT(B1,C1)"

    D1 will now show only the letters that fit your criteria.

    If you want to set the values in Col C numerically, each Arial font, Size 10, capital letter 'W'.is 1.86 characters, so you can use that as a multiple.

    If you can't use a "helper" column, it's all down to a simple Macro that measures and trims whatever you type into Col B

    Hope this helps

    Ochimus

+ 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 formula bar character limit & new rule problem
    By dhruti85chavda in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-09-2015, 06:27 PM
  2. Replies: 1
    Last Post: 11-27-2013, 04:53 PM
  3. Formula Character limit breached
    By Big Dingo in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 10-23-2012, 10:31 AM
  4. 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
  5. Replies: 1
    Last Post: 01-13-2011, 02:29 PM
  6. Setting an Overall width/height limit
    By Cypris in forum Excel General
    Replies: 3
    Last Post: 10-21-2006, 09:28 AM
  7. [SOLVED] Cell 255 character limit and formula
    By EaglesNest in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-26-2005, 08:07 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