top of page

You are learning Data Validation in MS Excel

How to validate data based on a formula result in Excel?

Unfortunately, Excel's built-in data validation functionality doesn't directly work with the results of formulas within the same cell. However, there are a couple of alternative approaches you can consider to achieve similar results:

1. Validate Input Data Used in the Formula:

This approach focuses on validating the data entered into the cells used by the formula, ensuring they meet the criteria for a valid outcome. Here's how:

* Identify Input Cells: Determine the cells whose values are used in the formula.
* Apply Data Validation: Select these input cells and go to the "Data" tab. Click on "Data Validation" in the "Data Tools" group.
* Set Validation Rules: In the "Settings" tab, choose the appropriate data validation rule based on your needs (e.g., allow only numbers within a specific range). Define the criteria for acceptable values.
* Formula Outcome: Since the formula references validated cells, any invalid input will be prevented, indirectly ensuring a valid formula result.

2. Conditional Formatting based on Formula:

This method uses conditional formatting to highlight or display a message if the formula result doesn't meet your criteria. Here's how:

* Format the Cell: Select the cell containing the formula. Go to the "Home" tab and choose the formatting options you want to apply if the formula result is invalid (e.g., red background fill).
* Conditional Formatting Rules: Navigate to the "Conditional Formatting" section and click "New Rule."
* Use a formula to determine formatting: Choose "Use a formula to determine which cells to format" and enter a formula that checks the validity of the result.
* Example: `=A1>100` (where A1 is the cell with the formula and 100 is your threshold).
* Apply Formatting: Click "Format" and choose the formatting you set earlier (red background fill in this case).
* Outcome: If the formula result exceeds 100 (your criteria), the cell will be highlighted with the red fill, indicating a potential issue.

Remember: These methods don't directly prevent invalid formula results, but they offer workarounds to identify and address potential data issues.

bottom of page