Enable Conditional Data Entry in Excel using Data Validation (2023)

Excel is more than a data entry tool. But if you only talk about data entry in Excel, it’s a damn good one. Using the data validation, you can enable data entry in cell(s) based on a predefined condition.

Conditional Data Entry in Excel Using Data Validation

Here are a few examples of conditional data entry rules:

  • Allow data entry from a pre-defined list only (using drop-down lists).
  • Allow data entry only when the specified cell(s) are filled.
  • Allow DATE entry between two specified dates only.

You can also combine multiple conditions to create a data entry rule.

This type of conditional data entry in excel can be done using thedata validationfeature in Excel. It can enable data entry in the specified cells only when the specified conditions are met, else it shows an error.

Allow Data Entry from a Pre-defined List

You can restrict the user to choose from a list by creating a drop-down list. For example, suppose you have a list of countries as shown below, and you want to allow the entry of only one of these names in cell C1:

Enable Conditional Data Entry in Excel using Data Validation (1)

You can create a drop-down list that will restrict the entries to only the ones mentioned in the list. If you try to enter any other text string, it will show an error (as shown below):

Enable Conditional Data Entry in Excel using Data Validation (2)

Here is how you can create a drop-down list:

  • Select the cell where you want to show the drop down list. In this example, it is cells C1.
  • Go to Data –> Data Tools –> Data Validation.
    Enable Conditional Data Entry in Excel using Data Validation (3)
  • In the data validation dialogue box, select the settings tab and make the following changes:
    • Allow: List
    • Source: $A$1:$A$6 (you can use the range where you have the data).
    • Ignore Blank: Checked (uncheck this if you don’t want the user to enter blank).
    • In-cell dropdown: Checked (this would enable the drop down feature).
      Enable Conditional Data Entry in Excel using Data Validation (4)

This will create a drop-down list in the selected cell.

Now you can either select them from the drop-downlist, or manually enter the data in it. If you enter any data that is not from the source data, it will show an error.

CAUTION: If you copy and paste over the cell which has the data validation rules, the data validation rules disappear.

Download the Example File
Enable Conditional Data Entry in Excel using Data Validation (5)

Data Entry when a Dependent Cell is Filled

This could be the case when you want the user to go in a sequence and complete filling a form/questionnaire/survey.

Let’s say I have a something as shown below:

Enable Conditional Data Entry in Excel using Data Validation (6)

In this data set, I want the user to first fill the name (first name and last name is mandatory) and then move on to fill the date. If the user skips entering the name, then I want to show an error (as shown below):

Enable Conditional Data Entry in Excel using Data Validation (7)

This can easily be done using data validation. To do this:

  • Select the cell where you want to apply this condition. In theabove example, it is cell B5.
  • Go to Data –> Data Tools –> Data Validation
    Enable Conditional Data Entry in Excel using Data Validation (8)In the data validation dialogue box, select the settings tab and make the following changes:
    • Allow:Custom
    • Formula: =AND($B$1<>””,$B$3<>””).
    • Ignore Blank: Unchecked(make sure this is unchecked else it will not work).

Enable Conditional Data Entry in Excel using Data Validation (9)

In this case, we have used an AND function that checks whether both B1 and B3 have already been filled. If not, then it shows an error.

CAUTION: If you copy and paste over the cell which has the data validation rules, the data validation rules disappear.

Date Entry Between Two Specified Dates

There is an inbuilt feature in data validation that will let you do this. You can specify the upper and lower date limits, and if the user enters a date which is outside of this range, he/she will get an error.

To do this:

  • Select the cell where you want to apply this condition. In theabove example, it is cell B5.
  • Go to Data –> Data Tools –> Data Validation
    Enable Conditional Data Entry in Excel using Data Validation (10)In the data validation dialogue box, select the settings tab and make the following changes:
    • Allow:Date
    • Data:Between
    • Start Date: Enter the start date here (any date that is before this date will not be accepted).
    • End Date: Enter the end date here(any date that is afterthis date will not be accepted).Enable Conditional Data Entry in Excel using Data Validation (11)

You can also use a cell reference or a formula to specify the date. For example, you can use TODAY() function as one of the date limits (if you want the lower limit to the current date).

Since Excel stores the dates as numbers, you can also use numbers instead of dates. For example, instead of using 01-01-2015, you can also use the number 42005.

CAUTION: If you copy and paste over the cell which has the data validation rules, the data validation rules disappear.

Download the Example File
Enable Conditional Data Entry in Excel using Data Validation (12)

Multiple Data Entry Conditions

You can combine multiple conditions as well. For example, let’s say you want to enter a date in cell B5 with the following conditions:

  • First Name and the Last have already been filled by the user.
  • The entered date is between 01-01-2015 and 10-10-2015.

To do this:

  • Select the cell where you want to apply this condition. In theabove example, it is cell B5.
  • Go to Data –> Data Tools –> Data ValidationEnable Conditional Data Entry in Excel using Data Validation (13)
  • In the data validation dialogue box, select the settings tab and make the following changes:
    • Allow:Custom
    • Formula: =AND($B$1<>””,$B$3<>””,B5>=DATE(2015,10,1),B5<=DATE(2015,10,10))
    • Ignore Blank: Unchecked(make sure this is unchecked else it will not work)

Enable Conditional Data Entry in Excel using Data Validation (14)

This formula checks for four conditions – whether the two cells (B1 and B3 are already filled, and whether the date entered in cell B5 is within the specified date range).

CAUTION: If you copy and paste over the cell which has the data validation rules, the data validation rules disappear.

Download the Example File
Enable Conditional Data Entry in Excel using Data Validation (15)

Similarly, you can create and test for multiple conditions while allowing data entry in Excel.

You May Also Like the Following Excel Tips and Tutorials:

FAQs

Enable Conditional Data Entry in Excel using Data Validation? ›

Conditional data validation means restricting the choices in an Excel drop-down list depending on the value in another cell (or in another drop down, for that matter).

Can I put condition in data validation in Excel? ›

Conditional data validation means restricting the choices in an Excel drop-down list depending on the value in another cell (or in another drop down, for that matter).

How do you add an if condition in data validation? ›

In the Data Validation dialog box, you need to configure as follows.
  1. Stay in the Settings tab;
  2. Select List in the Allow drop-down list;
  3. Enter the following formula in the Source box; =IF($E$2=$B$2,$B$3:$B$6,$C$3:$C$6) Copy.
  4. Click the OK button. See screenshot:

How to create a data entry form in Excel with data validation? ›

How to add a new record
  1. Select any cell in your table.
  2. Click on the Form button on the Quick Access Toolbar or on the ribbon.
  3. In the input form, click the New button.
  4. Type the information in the appropriate fields.
  5. When done, hit the Enter key or click the New button again.
Mar 13, 2023

References

Top Articles
Latest Posts
Article information

Author: Nicola Considine CPA

Last Updated: 07/01/2024

Views: 6294

Rating: 4.9 / 5 (69 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Nicola Considine CPA

Birthday: 1993-02-26

Address: 3809 Clinton Inlet, East Aleisha, UT 46318-2392

Phone: +2681424145499

Job: Government Technician

Hobby: Calligraphy, Lego building, Worldbuilding, Shooting, Bird watching, Shopping, Cooking

Introduction: My name is Nicola Considine CPA, I am a determined, witty, powerful, brainy, open, smiling, proud person who loves writing and wants to share my knowledge and understanding with you.