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 includes more than 300 handy tools for Excel, free to try without limitation in 30 days. Download and Free Trial 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

Supercharge Your Spreadsheets: Experience Efficiency Like Never Before with Kutools for Excel

Popular Features: Find/Highlight/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   |   Unhide Columns   |   Compare Columns to Select Same & Different Cells ...
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 Toolset12 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, ...)   |   Many More...

Kutools for Excel boasts over 300 features, ensuring that what you need is just a click away...

Supports Office/Excel 2007-2021 & newer, including 365   |   Available in 44 languages   |   Enjoy a full-featured 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!

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.
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
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.
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?
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
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?
This comment was minimized by the moderator on the site
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!
This comment was minimized by the moderator on the site
thanks so much for the limiting of unputs. It helps a lot!
This comment was minimized by the moderator on the site
Thank you, very helpful!
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
#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
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
for a already filled sheet the above rule is not applicable. please provide guidance for already filled sheet.
This comment was minimized by the moderator on the site
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 - cialis online
This comment was minimized by the moderator on the site
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?
This comment was minimized by the moderator on the site
thanks!! it helps me a lot!! :lol:
This comment was minimized by the moderator on the site
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?
This comment was minimized by the moderator on the site
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.)
This comment was minimized by the moderator on the site
Really very Helpful....... thank you very much
This comment was minimized by the moderator on the site
Really Helpful... thank you very much
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
Very helpful, easy to learn. This was great, nice step by step instructions. Thank you.
This comment was minimized by the moderator on the site
This design is incredible! You obviously know how to keep a reader amused. dakgffedggeddgfe
This comment was minimized by the moderator on the site
I need to limit numerical inputs to show just the last 5 characters regardless of string size. can this be done in Excel?
This comment was minimized by the moderator on the site
use the following formula: =LEFT(cell #,# of characters you want to limit the field down to) Example: =LEFT(C1,30)
This comment was minimized by the moderator on the site
thanks amazing
This comment was minimized by the moderator on the site
in the next cell i need the characters from 31 to 60. so wat is the formala for that??? plz guide me
This comment was minimized by the moderator on the site
Thank you so much! This is exactly what I needed!!
This comment was minimized by the moderator on the site
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?
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
This was great, nice step by step instructions!
This comment was minimized by the moderator on the site
Thank you! Very helpful!
This comment was minimized by the moderator on the site
Really helpful. thanks a lot :-)
This comment was minimized by the moderator on the site
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
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
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!
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
It's not feasible @ end user is using the sheet.
This comment was minimized by the moderator on the site
Can you provide some instructions? Not sure how to accomplish what you are saying. What does "text to column" mean?
This comment was minimized by the moderator on the site
This is really helpful, is there anyway to make this count spaces too?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations