Office Settings & Configuration

Prevent Excel Users from Entering Values with Data Validation

Amos GikundaAmos Gikunda Nov 13, 2026 871 views

Question details

The user needs to restrict data entry in columns C and D of an Excel worksheet when the corresponding cell in column A is greater than zero, using a custom Data Validation rule.

Prevent Excel Users from Entering Values with Data Validation
Product
WPS Office Spreadsheets
Device & OS
not provided
Scenario
A spreadsheet owner wants to enforce a business rule so users cannot fill in certain columns when a related condition is met.
Observed behavior
Entries in columns C and D should be blocked automatically when the corresponding value in column A is greater than zero.
Before you start

Open the workbook in WPS Office Spreadsheets and confirm the exact range in columns C and D that needs protection. Note the row number of the first selected cell, because the custom formula must match that row.

Solution 1Recommended

Use a Custom Data Validation Formula to Block Entries in Columns C and D When Column A Is Greater Than Zero

Use this solution when you need Excel or WPS Office Spreadsheets to reject values in columns C and D for any row where column A is greater than zero.

The custom formula is relative to the active cell. The column reference $A is absolute so every selected row compares against its own value in column A, while the row number adjusts automatically. When the formula returns FALSE, the entry is invalid and the error alert appears.

1
Select the target cells

Open the workbook in WPS Office Spreadsheets, click the first cell in columns C or D, then drag to select the range such as C1:D100 where the restriction should apply.

2
Open Data Validation

Go to the Data tab on the ribbon and click Data Validation.

3
Choose Custom and enter the formula

In the Allow list, select Custom. In the Formula box, enter =IF($A1>0,FALSE,TRUE). If your selection starts in a row other than 1, change $A1 to match that active cell row, for example $A2 for row 2.

4
Configure the Error Alert

Click the Error Alert tab, choose Stop as the style, enter a title such as "Entry not allowed", and type a custom message telling users why the entry is blocked.

5
Save and test the rule

Click OK, then test by entering a value in a restricted cell when column A is greater than 0 to confirm it is blocked, and again when column A is 0 or blank to confirm it is allowed.

Use a Custom Data Validation Formula to Block Entries in Columns C and D When Column A Is Greater Than Zero
Data Validation is active: The rule now blocks entries in columns C and D when the corresponding value in column A is greater than zero.

Block Invalid Excel Entries with WPS Office Spreadsheets Data Validation

WPS Office Spreadsheets includes the same Data Validation feature, so you can apply a custom formula to columns C and D, add a Stop error alert, and prevent users from entering values when column A is greater than zero.

  1. 1. Open the workbook: Open the target workbook in WPS Office Spreadsheets.
  2. 2. Select columns C and D: Select the cells in columns C and D where the restriction is required, for example C1:D100.
  3. 3. Apply Custom Data Validation: Click the Data tab, open Data Validation, choose Custom, and enter =IF($A1>0,FALSE,TRUE).
  4. 4. Set a Stop error alert: On the Error Alert tab, choose Stop and add a clear message so users know why the entry is blocked.
Uses a native Data Validation rule to block invalid entries in columns C and D when column A exceeds zeroProvides full compatibility with Microsoft Excel .xlsx workbooks, formulas, and existing validation rulesOffers a familiar ribbon interface for quick adoption by Excel usersWPS Office is free, lightweight, and easy to install for everyday spreadsheet work
microsoft office alternative - wps office

Frequently Asked Questions

Can I apply this Data Validation rule to a range that starts in row 2 instead of row 1?

Yes. Select the range starting in row 2, open Data > Data Validation > Custom, and enter =IF($A2>0,FALSE,TRUE). Make sure the active cell is also in row 2 so the formula matches the selection start.

Why are users still able to type values in columns C or D?

Check that the Data Validation rule uses Custom, that the formula references column A with $A and the correct starting row, and that the Error Alert style is set to Stop. Also remove any previous validation rules or blank entries that may be bypassing the restriction.

Does this rule work in both WPS Office Spreadsheets and Microsoft Excel?

Yes. The Custom Data Validation formula and Error Alert settings work in both applications, and WPS Office Spreadsheets preserves the rule when you save in .xlsx format.

Can I apply the validation to entire columns C and D?

You can select columns C:D and use =IF($A1>0,FALSE,TRUE), but whole-column ranges can make the workbook slower. For better performance, use a specific range such as C1:D1000 when possible.

How do I remove this Data Validation rule later?

Select the same cells in columns C and D, go to Data > Data Validation, and click Clear All or Remove in the Data Validation dialog to delete the rule.