Function Problems

Show the Most Recent Conditional Alert in Excel or Google Sheets

Muhammad TalhaMuhammad Talha Dec 2, 2026 868 views

Question details

Display the alert associated with the most recently entered criterion in a spreadsheet cell.

Show the Most Recent Conditional Alert in Excel or Google Sheets
Product
Microsoft Excel or Google Sheets
Device & OS
not provided
Scenario
Multiple criteria can produce different alert messages, and the user wants the later alert to replace the earlier one.
Observed behavior
Conditional formatting changes a cell's appearance but does not replace its value with a new alert message.
Before you start

Decide whether the second criterion is always entered later or whether criteria can be updated in any order. Set aside separate cells for the inputs, alert messages, and the formula; use timestamp cells if entry order can vary.

Solution 1Recommended

Prioritize the later criterion with an IF formula

Use this approach when the second criterion is always the later one or should always take priority.

1
Set up the inputs and messages

Enter the first and second criteria in A2 and A3. Enter their corresponding alert messages in C2 and C3.

2
Enter the alert formula

Select the cell where you want the alert and enter =IF(A3<>"",C3,IF(A2<>"",C2,"")) in Excel or Google Sheets.

3
Check the result

Enter a value in A2, then another in A3. The formula displays C3 when A3 is nonblank; otherwise, it displays C2 when A2 is nonblank.

Prioritize the later criterion with an IF formula
Priority is not entry history: This formula always gives A3 priority. It does not detect which cell was edited most recently; use timestamps if either criterion can be updated later.
Work with alerts in WPS Spreadsheet

Display the later conditional alert in WPS Spreadsheet

Use WPS Spreadsheet to create a formula-driven alert that gives a later criterion priority over an earlier one.

  1. 1. Open a spreadsheet: Open WPS Spreadsheet and create a workbook or open an existing Excel file.
  2. 2. Enter criteria and alerts: Put the first and second criteria in A2 and A3, and their alert messages in C2 and C3.
  3. 3. Add the formula: Select an output cell and enter =IF(A3<>"",C3,IF(A2<>"",C2,"")) to display the second alert when its criterion is present.
  4. 4. Test the priority: Enter values in A2 and A3 and check that the output shows C3. Clear A3 to show C2 instead.
Display an alert message based on nonblank criteriaOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and cells
microsoft office alternative - wps office

Frequently Asked Questions

Can conditional formatting replace an alert message?

No. Conditional formatting changes appearance, such as color or font, but does not change the cell value. Use an IF formula in an output cell to return the alert text.

Does the IF formula know which criterion was entered last?

No. The formula =IF(A3<>"",C3,IF(A2<>"",C2,"")) gives A3 fixed priority. If either input can be updated later, record and compare timestamps instead.

What happens if both criteria are blank?

Both example formulas return an empty string when neither input qualifies, so the alert cell appears blank.

Can I use NOW() to record when a criterion was entered?

A regular NOW() formula recalculates, so it is not a reliable fixed record of an entry time. Enter a fixed date and time in the timestamp cell whenever you update the criterion.

Will the same formulas work in Excel and Google Sheets?

The cell-reference formulas shown here work in both applications. Depending on your spreadsheet's locale, you may need to use semicolons instead of commas between formula arguments.