Show a Warning in Excel When Three Cells Are 20 or More
Question details
Create a formula that displays Warning when at least three cells in a range contain values of 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.
Identify the range to check and choose a result cell outside it to avoid a circular reference. The example below checks C5:C31.
Use COUNTIF and IF to display the warning
Count cells at or above 20 and display a message when at least three qualify.
In Excel, select a cell outside C5:C31, such as D5.
In the formula bar, enter =IF(COUNTIF($C$5:$C$31,">=20")>=3,"Warning","") and press Enter.
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.

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. Open your spreadsheet: Open WPS Office, select Spreadsheets, and open the workbook containing your values.
- 2. Choose a result cell: Select a cell outside the range you want to check, such as D5 for values in C5:C31.
- 3. Enter the warning formula: In the formula bar, enter =IF(COUNTIF($C$5:$C$31,">=20")>=3,"Warning","") and press Enter.
- 4. Save the workbook: Use File > Save or Save As to save the workbook, choosing XLSX if you need an Excel-compatible file.

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.




