Function Problems

Show a Warning in Excel When Three Cells Are 20 or More

Adam DavisAdam Davis Dec 2, 2026 869 views

Question details

Create a formula that displays Warning when at least three cells in a range contain values of 20 or more.

Show a Warning in Excel When Three Cells Are 20 or More
Product
Microsoft Excel
Device & OS
not provided
Scenario
Check values in C5:C31 and show a message when at least three meet the threshold.
Observed behavior
The result should display Warning when three or more cells qualify and appear blank otherwise.
Before you start

Identify the range to check and choose a result cell outside it to avoid a circular reference. The example below checks C5:C31.

Solution 1Recommended

Use COUNTIF and IF to display the warning

Count cells at or above 20 and display a message when at least three qualify.

1
Select a result cell

In Excel, select a cell outside C5:C31, such as D5.

2
Enter the formula

In the formula bar, enter =IF(COUNTIF($C$5:$C$31,">=20")>=3,"Warning","") and press Enter.

3
Check the result

Review the selected cell: it displays Warning when at least three cells in C5:C31 contain values of 20 or more; otherwise, it appears blank.

Use COUNTIF and IF to display the warning
Adjust the range or threshold: Replace $C$5:$C$31 with your range, 20 with your value threshold, or 3 with the required number of qualifying cells.
WPS Spreadsheets

Create the same warning in WPS Spreadsheets

Use the same COUNTIF and IF formula in WPS Spreadsheets to check a range and display a warning when at least three values reach 20.

  1. 1. Open your spreadsheet: Open WPS Office, select Spreadsheets, and open the workbook containing your values.
  2. 2. Choose a result cell: Select a cell outside the range you want to check, such as D5 for values in C5:C31.
  3. 3. Enter the warning formula: In the formula bar, enter =IF(COUNTIF($C$5:$C$31,">=20")>=3,"Warning","") and press Enter.
  4. 4. Save the workbook: Use File > Save or Save As to save the workbook, choosing XLSX if you need an Excel-compatible file.
Count qualifying cells and display a warning with familiar spreadsheet functionsOpen and save Microsoft Excel XLSX filesUse a familiar spreadsheet interfaceEdit spreadsheets with a free Office suite
microsoft office alternative - wps office

Frequently Asked Questions

Does the formula include cells equal to 20?

Yes. The COUNTIF criterion ">=20" includes both 20 and values greater than 20.

How can I change the number of cells needed to trigger the warning?

Change the 3 in the comparison >=3. For example, use >=5 to display Warning when at least five cells qualify.

Can I check a different range?

Yes. Replace $C$5:$C$31 in the formula with your desired range, and place the formula outside that range.

Is the result cell empty when there is no warning?

It appears blank because IF returns an empty string, but the cell still contains a formula.