Get instant live expert help with Excel or Google Sheets
“My Excelchat expert helped me in less than 20 minutes, saving me what would have been 5 hours of work!”

Post your problem and you'll get expert help in seconds

Your message must be at least 40 characters
Our professional experts are available now. Your privacy is guaranteed.

Learn What Data Validation Must Begin with in Excel

Data validation is a powerful feature in Excel. We can use it to control how a string begins with. Using the EXACT and LEFT function with data validation, we can control how a value begins with. In this tutorial, we will learn how to validate the start of a value in Excel.

Figure 1. Example of how Data Validation Must Begin with in Excel

Generic Formula

=EXACT(LEFT(value,k),begin_with)

How the Formula Works

We can control how a cell value begins with data validation. The formula uses the EXACT and LEFT functions. The LEFT function extract the first k characters from the value.

Then, the EXACT function compares this text to the text provided into the formula. EXACT uses a case-sensitive approach in the comparison. EXACT returns TRUE when the two text strings match. If the match fails, Otherwise the validation fails and EXACT returns FALSE.

Setting up Data

The following contains an student information database. We will fill these up. Column A, B and C will have the name, id and classes.

To restrict the ids to begin with “Bk”, we need to:

  • Go to cell B2. Select cells B2 to B6 by clicking on B2 and dragging it till B6 with our mouse.
  • Go to Data> Data Validation. We need to click the settings tab.

Figure 2. Setting the Data Validation Rule

  • Next, we have to click on the drop down on the Allow box.
  • Here, we select Custom and in the formula box write the formula =EXACT(LEFT(B2,2),”Bk”).

Figure 3. Applying the Formula to Data Validation

  • Finally, we need to click OK.

This will only allow texts that start with “Bk” in column B. .

Figure 4. Error Message with Data Validation

Excel will show an error if we start the ids with anything other than “BK”.

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:

Leave a Comment

avatar

Subscribe to Excelchat.co

Get updates on helpful Excel topics

Subscribe to Excelchat.co

Did this post not answer your question?
Get a solution from connecting with the expert

Another blog reader asked this question today on Excelchat:

Post your problem and you'll get expert help in seconds

Your message must be at least 40 characters
Our professional experts are available now. Your privacy is guaranteed.
Trusted by people who work at
Amazon.com, Inc
Facebook, Inc
Accenture PLC
Siemens AG
Macy's
The Allstate Corporation
United Parcel Service
Dell Inc