Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to limit characters length in a cell in Excel?

Sometimes you may want to limit how many characters a user can input to a cell. For example, you want to limit up to 10 characters can be inputted in a cell. This tutorial will shows you the details to limit characters in cell in Excel.

Limit characters length in a cell

Set Input Message for text length limitation

Set Error Alert for text length limitation

One click to prevent from entering duplicate data in a single column/list

Easily prevent from typing special characters, numbers, or letters in a cell/selection in Excel

With Kutools for Excel's Prevent Typing feature, you can easily limit character types in a cell or selection in Excel. Full Feature Free Trial 30-day!
A. Prevent from typing in special characters, such as *, !, etc.;
B. Prevent from typing in certain characters, such as numbers, or certain letters;
C. Only allow to type in certain characters, such as numbers, letters, etc. as you need.
ad prevent typing chars

Office Tab Enable Tabbed Editing and Browsing in Office, and Make Your Work Much Easier...
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
  • Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
  • More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words...
  • Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum...
  • Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns...
  • Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Create Mailing List and Send Emails by Cell's Value...
  • Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
  • More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.

arrow blue right bubble Limit characters length in a cell

1. Select the range that you will limit date entries with specify character length.

2. Click the Data validation in the Data Tools group under Data tab.

3. In the Data Validation dialog box, select the Text Length item from the Allow: drop down box. See the following screen shot:

4. In the Data: drop down box, you will get a lot of choices and select one, see the following screen shot:

(1) If you want that others are only able to entry exact number of characters, says 10 characters, select the equal to item.
(2) If you want that the number of inputted character is no more than 10, select the less than item.
(3) If you want that the number of inputted character is no less than 10, select the greater than item.

4. Entry exact number that you want to limit in Maximum/Minimum/Length box according to your needs.

5. Click OK.

Now users can only enter text with limited number of characters in selected ranges.

arrow blue right bubble Set Input Message for text length limitation

The Data Validation allows us to set input message for text length limitation besides selected cell as below screenshot shown:

1. In the Data Validation dialog box, switch to the Input Message tab.

2. Check the Show input message when cell is selected option.

3. Entry the message title and message content.

4. Click OK.

Now go back to the worksheet, and click one cell in selected range with text length limitation, it displays a tip with the message title and content. See the following screen shot:


arrow blue right bubble Set Error Alert for text length limitation

Another alternative way to tell user the cell is limited by text length is to set an error alter. The error alert will be shown after you entry invalid data. See screenshot:

1. In the Data Validation dialog box, switch to the Error Alert dialog box.

2. Check the Show error alert after invalid data in entered option.

3. Select the Warning item from the Style: drop down box.

4. Input the alert title and alert message.

5. Click OK.

Now if the text you entered in a cell is invalid, for example it contains more than 10 characters, a warning dialog box will pop up with preset alert title and message. See the following screen shot:


Demo: limit characters length in cells with input message & alert warning

In this Video, Kutools and Kutools Plus tabs are added by Kutools for Excel. If need it, please click for 30-day free trial without limitation!

One click to prevent from entering duplicate data in a single column/list

Comparing to setting data validation one by one, Kutools for Excel's Prevent Duplicate utility supports Excel users to prevent from duplicate entries in a list or a column with only one click. Full Feature Free Trial 30-day!
ad prevent typing duplicates


Related Article:

How to limit cell value entries in Excel?


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Tomas · 2 months ago
    Hi, do you know how to put exact length limit 10 and when put abc i want from excel to put 8 space?
    I want to set a cell to 10 character, when input 2 character then will auto fill up with 8 space after. if the cell is blank, then return with 10 space. this is for setting a excel file for user input and save as txt or cvs file for import to other software.
  • To post as a guest, your comment is unpublished.
    question · 1 years ago
    I want to limit the quantity of a cell depending on the category of another one,

    For example if I input in A1 "Ok" in B1 must be limit to 10 characters
    but if A1= "NG", B1 must be limit to 12 characters.
  • To post as a guest, your comment is unpublished.
    Eliza · 2 years ago
    [quote name="Ivan"]Hi, do you know how to put exact length limit 10 and when put abc i want from excel to put 8 space?[/quote]
    I want to set a cell to 10 character, when input 2 character then will auto fill up with 8 space after. if the cell is blank, then return with 10 space. this is for setting a excel file for user input and save as txt or cvs file for import to other software
  • To post as a guest, your comment is unpublished.
    ARNAB DEBNATH · 2 years ago
    Hi,
    I have a attendance sheet. from 1 to 31. I put "P" on each cell if person is present.
    Now I want that how many times "P" is continuing present in cell.
    As as example - I have put "P" from 1 to 6 , then from 8th to 9th put P, and 10th is gap. then from 11th its continue to 18th. ...
    now i want how many times P is continue 6 time . PPPPPP PP PPPPPPPP
    Manually the answer is : 2(1to6 = 1,11to18=1)
    If you have any formula to count this it will be a great help.
    • To post as a guest, your comment is unpublished.
      Paul · 2 years ago
      =COUNTIF(B2:B17,">""") this formula will ignore empty cells but will count cells with data in i.e. P
  • To post as a guest, your comment is unpublished.
    Shawn · 3 years ago
    Hi. I want out put txt file and no spaces between cell values. Like 3 cells with First Name, Middle and last. Entered Shawn G Goldman as SHAWNGGOLDMAN
  • To post as a guest, your comment is unpublished.
    Shawn · 3 years ago
    Hi I want few things in a cell. I only want numbers in cell. I want to limit to 10 characters. I want to remove decimal like 15.00 to 1500. I want to indent to right. Also to add 0's to left to make it 10 characters .like 15.00 to 0000001500
  • To post as a guest, your comment is unpublished.
    Praveen · 3 years ago
    Sir, How to set Cells with following Condition
    If one letter will enter go to first cell and 2nd letter automatically goto next cell. How we will set this. Help me.
  • To post as a guest, your comment is unpublished.
    Eric · 3 years ago
    Hello. Is it possible to stop when it reaches a certain character?
    For example, I want it to stop with a warning message when it exceeds 80 characters before I hit "enter."

    Thank you.
  • To post as a guest, your comment is unpublished.
    Viraf · 3 years ago
    Scenario Column width which can take 55 characters maximum, I have set up Data validation in Settings Text Length, Between, Minimum 0 and Maximum 55 used Input message and Error Alert. When the data exceeds it brings up the message as mentioned in Error Alert of "Retry" to input again or "Cancel" to truncate excess characters. However, it is truncating the whole data entered and makes the line blank rather than truncating any excess characters, what I want to achieve here is if there are any excess characters entered in column E over 55 to be truncated and not the full data.
    How can I achieve truncation only excess characters and not the whole data entered, I s there a way I can achieve this and the data is entered by the customer so I do not want them to get confused as to what needs to be done.
    Thanking you in advance.
  • To post as a guest, your comment is unpublished.
    Ivan · 3 years ago
    Hi, do you know how to put exact length limit 10 and when put abc i want from excel to put 8 space?
  • To post as a guest, your comment is unpublished.
    Vijay Devjani · 3 years ago
    Hi Pal.

    Data validation doesnt work on pivot table. so what to do when i want to restrict the size of cells in a pivot table.
  • To post as a guest, your comment is unpublished.
    Jenn · 3 years ago
    I am finding a way to restrict user to entering too many Korean and English characters in excel file. As Korean characters are in double bytes and English characters are in single bytes, it seems impossible for me to use data validation. Is there any way I can try to combine both in data validation so that user doesn't enter more than 25 bytes?
  • To post as a guest, your comment is unpublished.
    Sokunth · 4 years ago
    I have two condition.
    1 - If Column B1 = A Set Text Length = 6
    2 - If Column B1 = B Set Text Length = 13

    Please Guide Me!
  • To post as a guest, your comment is unpublished.
    mark mandane · 4 years ago
    thanks so much for the limiting of unputs. It helps a lot!
  • To post as a guest, your comment is unpublished.
    sinks · 4 years ago
    Thank you, very helpful!
  • To post as a guest, your comment is unpublished.
    charlotte · 4 years ago
    i created a form with multiple rows that will be interactive and filled in by my staff. The problem is they are typing everything in one row creating an extremly long row, when there are still several unused rows below.

    How can I put a limit on the characters in each row? Is there a way in excel for the data to move automatically to the new row, after the first row exceeds its character limit? Please help.
  • To post as a guest, your comment is unpublished.
    sjlrl · 4 years ago
    #Manish You could use the LEFT(cell,30) function. Say your data is in A1. At A2 enter =LEFT(A1,30) then copy A2 to A1
  • To post as a guest, your comment is unpublished.
    jack · 5 years ago
    Is it possible do the following 2 functions. I need to limit a cell to 40 characters with existing characters.
    After concatenating two cells the characters being added to the right of the cell to end up to the far right.
  • To post as a guest, your comment is unpublished.
    Manish Singh · 5 years ago
    for a already filled sheet the above rule is not applicable.

    please provide guidance for already filled sheet.
  • To post as a guest, your comment is unpublished.
    Marcela · 5 years ago
    I'm truly enjoying the design and layout of your blog.
    It's a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out
    a designer to create your theme? Fantastic work!

    Also visit my weblog - [url=http://onlineedmeds03.com/]cialis online[/url]
  • To post as a guest, your comment is unpublished.
    DonnaC · 5 years ago
    I tried this but my entries have a combination of numbers and letters and many begin with a number. This will make all that begin with a number as invalid. How do I keep this from happening?
  • To post as a guest, your comment is unpublished.
    jemuel · 5 years ago
    thanks!! it helps me a lot!! :lol:
  • To post as a guest, your comment is unpublished.
    Tom · 5 years ago
    I have used the data validation to set a character limit. However, if the limit is exceeded and the warning message appears, you can just press cancel with no consequence. How do I prevent this?
  • To post as a guest, your comment is unpublished.
    dora · 5 years ago
    I want to make sure that the cell is not empty. User can type another value, but shouldn't be able to delete it. I used text length, given that it has to be min. 1 character. I have set input message and error alert as well. Doesn't work. Tried with ticking ignore bland and without it as well. No luck. You can still delete the value. (If I use "less than", that works fine with message and alert.)
  • To post as a guest, your comment is unpublished.
    Shashi · 5 years ago
    Really very Helpful....... thank you very much
  • To post as a guest, your comment is unpublished.
    Shashi · 5 years ago
    Really Helpful... thank you very much
  • To post as a guest, your comment is unpublished.
    Vara Vemula · 5 years ago
    while converting txt to excel if the txt file contain a cell value more than 15 characcter it is rounding off. is there any formulat that helps to rpevent this.
  • To post as a guest, your comment is unpublished.
    Subhadeep · 5 years ago
    Very helpful, easy to learn. This was great, nice step by step instructions. Thank you.
  • To post as a guest, your comment is unpublished.
    Smithd476 · 5 years ago
    This design is incredible! You obviously know how to keep a reader amused. dakgffedggeddgfe
  • To post as a guest, your comment is unpublished.
    Roy · 5 years ago
    I need to limit numerical inputs to show just the last 5 characters regardless of string size.
    can this be done in Excel?
  • To post as a guest, your comment is unpublished.
    JENN · 5 years ago
    use the following formula:
    =LEFT(cell #,# of characters you want to limit the field down to)
    Example:
    =LEFT(C1,30)
    • To post as a guest, your comment is unpublished.
      Lynell · 3 years ago
      Thank you so much! This is exactly what I needed!!
  • To post as a guest, your comment is unpublished.
    Webstarr · 5 years ago
    Is it possible to set a data validation on a cell containing a concatenate formula? I am concatenating several cells' values and would like to warn the individual entering data if the count exceeds 50 characters. However, I don't want to use the =LEFT function as I need the user to edit his input values, rather than have Excel only return the first 50 characters.

    Any ideas?
  • To post as a guest, your comment is unpublished.
    RedHair4ever · 5 years ago
    Is it possible to use this with a scanner for barcode? After the scan is done (X digits) can "enter" be done automatically so it will positionned itself in the next cell so I can scan lots of items without to manually press enter ?

    Any help will be welcome, I don't have any idea how to resolve this.
  • To post as a guest, your comment is unpublished.
    bachocron · 5 years ago
    This was great, nice step by step instructions!
  • To post as a guest, your comment is unpublished.
    Misty · 5 years ago
    Thank you! Very helpful!
  • To post as a guest, your comment is unpublished.
    Mudassar · 5 years ago
    Really helpful. thanks a lot :-)
  • To post as a guest, your comment is unpublished.
    Bart · 5 years ago
    Thanks for the information.

    Is it possible to limit existing text in a column to 30 characters and erase everything that exceeds that limited amount of characters?

    Thank you
    • To post as a guest, your comment is unpublished.
      Matthiasagreen · 5 years ago
      Use text to column, choose fixed width and choose the character count you want. It will separate antything above the limit to a new column that you can delete.
  • To post as a guest, your comment is unpublished.
    Rutger · 5 years ago
    The data validations to limit text length input are clear, but unfortunately validations stop the moment you copy text from another field which exceeds the max in the target field.

    Can that be prevented in some way?

    Would appricate userful respons!
    • To post as a guest, your comment is unpublished.
      Matthiasagreen · 5 years ago
      Use text to column, choose fixed width and choose the character count you want. It will separate antything above the limit to a new column that you can delete.
      • To post as a guest, your comment is unpublished.
        Ashish · 5 years ago
        It's not feasible @ end user is using the sheet.
      • To post as a guest, your comment is unpublished.
        Friday5 · 5 years ago
        Can you provide some instructions? Not sure how to accomplish what you are saying. What does "text to column" mean?
  • To post as a guest, your comment is unpublished.
    NyPy · 5 years ago
    This is really helpful, is there anyway to make this count spaces too?