Skip to main content

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

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.

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.


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

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:


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


Kutools for Excel: Over 300 handy tools at your fingertips! Start your 30-day free trial with no feature limitations today. Download Now!

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.


ad prevent typing duplicates


Related Article:

How to limit cell value entries in Excel?

Best Office Productivity Tools

Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

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!

Comments (53)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
why date and number is allowed at text length?
This comment was minimized by the moderator on the site
Hi there, if you want me to explain, numbers are also characters. So if you set the max length less than 10 characters, as long as you don't input 10 or more number characters, you will be good.

Amanda
This comment was minimized by the moderator on the site
This is almost the exact solution I need but still need a bit more help. What I'm trying to achieve is to set a cell to have a max of 40 characters but not stop the user from entering all the data he needs, instead i would like anything over the 40 character limit to be populated in a second designated cell. Is this even a possibility? Thank you everyone in advance for any assistance provided.
This comment was minimized by the moderator on the site
This comment was minimized by the moderator on the site
I saw Tomas question about putting an exact limit of 10 spaces and your formula =A1&REPT(" ",10-LEN(A1)) however I need to take it a step further. I want to take three separate fields that I have set their spaces to exactly 10 and concatenate them with their "spaces" intact. Also, if I don't limit what they enter and they enter MORE than 10 characters in one of the cells I want to take ONLY the first 10. So as an example, I want to give them three cells they can enter information in. I don't want to limit what they input BUT, I want to concatenate these three fields and pick up 10 characters from each one. So if the first cell has 4 characters, in my concatenate formula I want it to pick up the 4 characters PLUS 6 spaces. If the second field has 20 characters, I want to only pick up the first 10 characters and the same thing for the third cell. We are trying to get to a uniform 30 characters of description but some names are longer or shorter than others. We want this to break evenly with 10 characters per cell. Hopefully this is making sense.
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
Hi Tomas,
You can use a formula to limit the text length: =A1 & REPT(" ",10-LEN(A1))
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
[quote]Hi, do you know how to put exact length limit 10 and when put abc i want from excel to put 8 space?By Ivan[/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
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
=COUNTIF(B2:B17,">""") this formula will ignore empty cells but will count cells with data in i.e. P
This comment was minimized by the moderator on the site
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
This comment was minimized by the moderator on the site
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
This comment was minimized by the moderator on the site
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.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations