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. Click for 60-day free trial!
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


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

Tip: In this Video, Kutools tab and Enterprise tab are added by Kutools for Excel. If you need it, please click here to have a 60-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. Click for 60-day free trial!
ad prevent typing duplicates


Related Article:

How to limit cell value entries in Excel?

 

Recommended Productivity Tools

Office Tab

gold star1 Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.

Kutools for Excel

gold star1 Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!

gold star1 200 New Features for Excel, Make Excel Much Easy and Powerful:

  • Merge Cell/Rows/Columns without Losing Data.
  • Combine and Consolidate Multiple Sheets and Workbooks.
  • Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
  • Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,
  • More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...

Screen shot of Kutools for Excel

btn read more btn download btn purchase

Comments  

Permalink +5 NyPy
This is really helpful, is there anyway to make this count spaces too?
2013-12-03 10:46 Reply Reply with quote Quote
Permalink +8 Rutger
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!
2013-12-17 16:23 Reply Reply with quote Quote
Permalink +3 Matthiasagreen
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.
2014-01-17 16:34 Reply Reply with quote Quote
Permalink +1 Friday5
Can you provide some instructions? Not sure how to accomplish what you are saying. What does "text to column" mean?
2014-01-31 15:26 Reply Reply with quote Quote
Permalink 0 Ashish
It's not feasible @ end user is using the sheet.
2014-09-24 14:11 Reply Reply with quote Quote
Permalink +1 Bart
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
2014-01-09 17:52 Reply Reply with quote Quote
Permalink +7 Matthiasagreen
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.
2014-01-17 16:34 Reply Reply with quote Quote
Permalink 0 Mudassar
Really helpful. thanks a lot :-)
2014-01-28 09:33 Reply Reply with quote Quote
Permalink 0 Misty
Thank you! Very helpful!
2014-02-20 15:27 Reply Reply with quote Quote
Permalink 0 bachocron
This was great, nice step by step instructions!
2014-02-27 18:53 Reply Reply with quote Quote
Permalink +1 RedHair4ever
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.
2014-03-19 18:23 Reply Reply with quote Quote
Permalink +1 Webstarr
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?
2014-04-03 16:25 Reply Reply with quote Quote
Permalink +2 JENN
use the following formula:
=LEFT(cell #,# of characters you want to limit the field down to)
Example:
=LEFT(C1,30)
2014-05-02 21:15 Reply Reply with quote Quote
Permalink 0 Lynell
Thank you so much! This is exactly what I needed!!
2016-08-30 18:45 Reply Reply with quote Quote
Permalink +1 Roy
I need to limit numerical inputs to show just the last 5 characters regardless of string size.
can this be done in Excel?
2014-05-23 22:11 Reply Reply with quote Quote
Permalink 0 Smithd476
This design is incredible! You obviously know how to keep a reader amused. dakgffedggeddgf e
2014-06-02 11:53 Reply Reply with quote Quote
Permalink 0 Subhadeep
Very helpful, easy to learn. This was great, nice step by step instructions. Thank you.
2014-06-16 10:03 Reply Reply with quote Quote
Permalink +1 Vara Vemula
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.
2014-07-16 19:22 Reply Reply with quote Quote
Permalink 0 Shashi
Really Helpful... thank you very much
2014-08-07 06:57 Reply Reply with quote Quote
Permalink 0 Shashi
Really very Helpful....... thank you very much
2014-08-07 06:57 Reply Reply with quote Quote
Permalink 0 dora
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.)
2014-08-25 17:44 Reply Reply with quote Quote
Permalink 0 Tom
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?
2014-09-11 10:20 Reply Reply with quote Quote
Permalink 0 jemuel
thanks!! it helps me a lot!! :lol:
2014-09-22 05:27 Reply Reply with quote Quote
Permalink 0 DonnaC
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?
2014-10-07 15:56 Reply Reply with quote Quote
Permalink +1 Marcela
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
2014-11-04 03:39 Reply Reply with quote Quote
Permalink 0 Manish Singh
for a already filled sheet the above rule is not applicable.

please provide guidance for already filled sheet.
2014-11-10 12:04 Reply Reply with quote Quote
Permalink 0 jack
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.
2014-11-14 01:14 Reply Reply with quote Quote
Permalink +2 sjlrl
#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
2014-12-07 12:14 Reply Reply with quote Quote
Permalink 0 charlotte
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.
2015-04-18 17:37 Reply Reply with quote Quote
Permalink 0 sinks
Thank you, very helpful!
2015-08-14 19:44 Reply Reply with quote Quote
Permalink 0 mark mandane
thanks so much for the limiting of unputs. It helps a lot!
2015-09-04 01:14 Reply Reply with quote Quote
Permalink 0 Sokunth
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!
2015-10-20 03:07 Reply Reply with quote Quote
Permalink 0 Jenn
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?
2016-05-16 01:12 Reply Reply with quote Quote
Permalink 0 Vijay Devjani
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.
2016-06-03 07:14 Reply Reply with quote Quote
Permalink 0 Ivan
Hi, do you know how to put exact length limit 10 and when put abc i want from excel to put 8 space?
2016-06-09 16:33 Reply Reply with quote Quote
Permalink 0 Viraf
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.
2016-06-14 03:33 Reply Reply with quote Quote
Permalink 0 Eric
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.
2016-06-29 15:36 Reply Reply with quote Quote
Permalink 0 Praveen
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.
2016-08-05 07:22 Reply Reply with quote Quote
Permalink 0 Shawn
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
2016-10-06 17:06 Reply Reply with quote Quote
Permalink 0 Shawn
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
2016-10-06 17:09 Reply Reply with quote Quote
Permalink 0 ARNAB DEBNATH
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.
2016-12-02 12:05 Reply Reply with quote Quote
Permalink 0 Paul
=COUNTIF(B2:B17 ,">""") this formula will ignore empty cells but will count cells with data in i.e. P
2017-01-03 12:10 Reply Reply with quote Quote
Permalink 0 Eliza
Quoting Ivan:
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
2017-06-09 13:16 Reply Reply with quote Quote

Add comment


Security code
Refresh