How to limit entries to only allow values that start/End with certain texts in Excel?
This tutorial explains how to use data validation to allow only values that begin with or end with certain characters in Excel.
Only allow texts that start or end with certain characters in cells
More tutorials for Data validation...
Only allow texts that start or end with certain characters in cells
Please do as follows to only allow texts that start or end with certain characters in cells in Excel.
1. Select the range of cells that you only allow texts that start or end with certain characters.
2. Click Data > Data Validation > Data Validation. See screenshot:
3. In the Data Validation dialog box, please configure as follows.
- 3.1 Select Custom from the Allow drop-down list;
- 3.2 For allowing texts that start with certain characters, please copy the below formula into the Formula box;
- =EXACT(LEFT(A2,3),"KTE")
- And for allowing texts that end with certain characters, please copy the below formula into the Formula box;
- =EXACT(RIGHT(A2,3),"KTE")
- 3.3 Click the OK button.
Notes:
- 1. In the formulas, A2 is the first cell of the selected range; 3 is the number of characters you specified, KTE is the start or end text.
- 2. These two formulas are case-sensitive.
- 3. If you don’t need case-sensitive, please apply the below CONTIF formulas:
- Only allow texts that start with KTE in a range of cells
- =COUNTIF(A2,"KTE*")
- Only allow texts that end with KTE in a range of cells
- =COUNTIF(A2,"*KTE")
4. And then, click OK button. From now on, only the text string begins or ends with the centain characters you specified can be entered into the selected cells.
Related articles
Allow only date format in specific cells
How could you restrict a list of cells to only allow entering date format in Excel worksheet? In this article, we will talk about some interesting tricks for dealing with this job.
Validate email addresses in a column of worksheet
As we all known, a valid email address is composed of three parts, the user name, the "at symbol" (@), and the domain. Sometimes, you just allow others to enter only the email address format text into a specific column of worksheet. Methods in this article will make it possible to achieve in Excel.
Apply data validation to force phone number format in Excel
May be, there are various phone number formats can be used when typing into the Excel workbook. But, how could you only allow one phone number format to be entered in a column of worksheet? For example, I just want the phone number as this format 123-456-7890 to be allowed entering. The methods in this article will do you a favor.
Use data validation to only allow SSN number entered in Excel
For recording the SSN number of all employees and forcing them to type the SSN number in xxx-xx-xxxx format in a column, you can use the Data Validation function to solve the problem.
Three methods to validate cells to only accept IP address in Excel
While using Excel, do you know how to set up a column or a range of cells to only accept IP address format (xxx.xxx.xxx.xxx)? This article provides several methods for you to deal with it.
Best Office Productivity Tools
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...
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!