How to Restrict Data Entry in Excel Cell (2 Simple Methods)

The following dataset contains the names of students in a column. We’ll restrict the data entry in the Project Code column.

2 Simple Methods to Restrict Data Entry in Excel Cell

Method 1 – Using Data Validation

Case 1 – All Types of Data Entry Restriction

  • Select the cell range C5:C9.

All Types of Data Entry Restriction

  • Go to the Data tab, choose the Data Tools group, select the Data Validation drop-down and click on Data Validation.

All Types of Data Entry Restriction

  • The Data Validation dialog box appears.
  • Go to the Settings tab and select the option Text length from the Allow drop-down list.

All Types of Data Entry Restriction

  • Choose equal to from the Data drop-down list and type 0 in the Length field.

All Types of Data Entry Restriction

  • Go to the Error Alert tab and type Restrict Data Entry in the Title field.
  • Type a message in the Error message box. This message with the Title will show up when a user tries to enter data in specific cells.
  • Click OK.

  • Select cell C5 and type 1 in that cell.
  • Press Enter.

  • You’ll get an error warning box.

Read More: How to Check for Data Entry Errors in Excel

Case 2 – Limit Data Entry to Allow Only Number

  • Select the cell range.
  • Go to the Data tab, select the Data Validation drop-down, and pick Data Validation.
  • The Data Validation dialog box appears. Go to the Settings tab and select the option Custom from the Allow drop-down list.
  • In the Formula field, insert the following formula: =ISNUMBER(C5:C9)This formula checks whether the values in the range C5 to C9 are numbers.
  • In the Error Alert tab, insert the desired title and error message.
  • Click on OK.

Limit Data Entry to Allow Only Number

  • Type ASD in cell C5.

Limit Data Entry to Allow Only Number

  • Press Enter.
  • You will see an error message box.

Case 3 – Limit Data Entry to Allow Whole Numbers in a Specific Range

  • Select the cell range.
  • Go to the Data tab and select Data Validation.
  • The Data Validation dialog box appears. Go to the Settings tab.
  • Select the option Whole number from the Allow dropdown list.
  • Select between from the Data drop-down list.
  • Put 1 in the Minimum field and 100 in the Maximum field.

Allow Only Whole Number

  • Go to the Error Alert tab.
  • Insert the Title and the Error message.
  • Click OK.

Allow Only Whole Number

  • Type the value 125 in cell C5.
  • Press Enter.

  • An error message box appears.

Case 4 – Decimal Numbers in a Specific Range Allowed

  • Select the cell range.
  • Go to the Data tab and select Data Validation.
  • The Data Validation dialog box appears. Go to the Settings tab.
  • From the Allow drop-down list, choose Decimal.
  • Select between from the Data drop-down list.
  • Fill in the Minimum and Maximum fields with the values 1 and 100, respectively.
  • In the Error Alert tab, insert the desired title and error message.
  • Click OK.

Only Decimal Numbers Allowed

  • Select cell C5. Type a 122.8 in that cell.
  • Hit Enter.

Only Decimal Numbers Allowed

  • You’ll see an error message box.

Case 5 – Restrict Data Entry to Allow a List

To restrict data entry to a list:

  • Select the cell range.
  • Go to the Data tab and select Data Validation.
  • The Data Validation dialog box appears. Go to the Settings tab.
  • Select the option List from Allow drop-down list.
  • Type a list of values in the Source box.
  • Click on OK.

Restrict Data Entry to a List

  • A drop-down icon appears beside the selected cells. You can only insert values in the cells from the list. Otherwise, it will show an error.

Restrict Data Entry to a List

  • Type 23R in cell C5. The value is not in the defined list.

  1. Press Enter.

You will see an error message box.

Case 6 – Limit Data Entry to a Date Range

To limit data entry to a range of dates:

  • Select the cell range.
  • Go to the Data tab and select Data Validation.
  • The Data Validation dialog box appears. Go to the Settings tab.
  • Select Date from the Allow drop-down list and choose between from the Data drop-down list.
  • Type the starting date and ending date in the Start date and End date fields, respectively.
  • Click OK.

Limit Data Entry to a Date Range

  • Type a date outside the specified range.

Limit Data Entry to a Date Range

  • Press Enter.
  • You’ll get an error message box.

Case 7 – Restrict Data Entry to a Specific Time Range

  • Select the cell range.
  • Go to the Data tab and select Data Validation.
  • The Data Validation dialog box appears. Go to the Settings tab.
  • Select Time from the Allow drop-down list and choose between from the Data drop-down list.
  • Set the values in the Start time and End time fields.
  • Click OK.

Restrict Data Entry to Allow Time

  • Type 6:00:00 PM in cell C5.

Restrict Data Entry to Allow Time

  • Press Enter.
  • You’ll get an error message box since the value is outside the defined range.

Read More: How to Record Time of Data Entry in Excel

Case 8 – Restrict Data Entry to Allow Only Text

  1. Select the cell range.
  2. Go to the Data tab and select Data Validation.
  3. The Data Validation dialog box appears. Go to the Settings tab.
  4. Select the option Custom from the Allow drop-down list.
  5. In the Formula field insert the following formula: =ISTEXT(C5:C9). This formula checks whether the values in the range C5 to C9 are text.
  6. Click OK.

Restrict Data Entry to Allow Only Text

  • Type the numeric value 222 in cell C5.

Restrict Data Entry to Allow Only Text

  • Press Enter.
  • An error message box will appear.

Method 2 – Protecting the Excel Worksheet

Step 1 – Unlock the Entire Worksheet

  • Click on the triangle icon in the left corner to select the entire worksheet.
  • Right-click and select the option Format Cells from the Context Menu.

Protect Worksheet to Restrict Data Entry in Excel Cell

  1. The Format Cells dialogue box appears. Go to the Protection tab.
  2. Uncheck the option Locked.
  3. Click OK.

Protect Worksheet to Restrict Data Entry in Excel Cell

Step 2 – Lock a Specific Range of Cells

  • Select the cell range B5:B9.
  • Right-click and select the option Format Cells.

Protect Worksheet to Restrict Data Entry in Excel Cell

  • Go to the Protection tab in the Format Cells dialogue box.
  • Check the option Locked.
  • Click OK.

Protect Worksheet to Restrict Data Entry in Excel Cell

Step 3 – Protect Worksheet

  • Go to the Review tab and select Protect Sheet.

Protect Worksheet to Restrict Data Entry in Excel Cell

  • The Protect Sheet dialog box appears. Type a password. We are using 1234.
  • Click OK.

  • A Confirm Password dialog box will appear. Re-enter the password.
  • Click OK.

  • Select cell B5. Start typing in any value.

Protect Worksheet to Restrict Data Entry in Excel Cell

  • You will get a warning box.

Download Practice Workbook

You can download the practice workbook from here.

Frequently Asked Questions

Why would I want to restrict data entry in Excel cells?

Restricting data entry helps ensure accuracy, prevent errors, and maintain consistency in your spreadsheet. It allows you to enforce specific rules and criteria for data input.

Can I protect specific cells or ranges in Excel from being edited?

Yes, you can protect specific cells or ranges by locking the cells and then protecting the sheet. This is useful for preserving formulas or restricting changes to critical data.

Can I restrict data entry based on a predefined list of options?

Yes, you can create drop-down lists in Excel, allowing users to choose from predefined options. This helps standardize data entry and reduces the risk of input errors.

Related Articles


<< Go Back to Data Entry in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Mukesh Dipto
Mukesh Dipto

Mukesh Dipto is an excellent marine engineer who loves working with Excel and diving into VBA programming. For him, programming is like a superhero tool that saves time when dealing with data, files, and the internet. His skills go beyond the basics, including Rhino3D, Maxsurf C++, AutoCAD, HTML, CSS, JavaScript, and WordPress. He got his B.Sc in Naval Architecture & Marine Engineering from BUET, and now he's switched gears, working as a content developer. In this role, he... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo