ONCHANGE
Returns initial_value until the range changes, then returns value_after_change and converts the cell to a static value
Syntax
ONCHANGE(range, initial_value, value_after_change)
Arguments
| Argument |
Description |
Required |
range |
The cell range to monitor for changes |
Required |
initial_value |
The value to return when the range has not changed |
Required |
value_after_change |
The value to return and convert to when the range changes |
Required |
Examples
Monitor cell changes and log timestamp
=ONCHANGE(A1, "Waiting...", NOW())
Result ⇒
Waiting... (until A1 changes)
Track range modifications
=ONCHANGE(A1:A3, "Unchanged", "Data Modified!")
Result ⇒
Unchanged (until range changes)
Conditional calculation on change
=ONCHANGE(A1, 0, SUM(B1:B10))
Result ⇒
0 (until A1 changes, then calculates sum)
Related Functions
Other Special Functions & Keywords functions:
- CELL - Current cell value in criteria formulas
- COL - Column value using COL[A] or COL[1] syntax
- ONCE - Returns the value of the inner formula and only executes once, turning the cell into a value
- RECORDID - Salesforce record ID for this workbook
- TAGS - Converts a table with headers and rows into a JSON object array. There should be a "label" column and each row is rendered as a hoverable tag with that label.
- USERID - Current logged-in user's ID
← Back to Formula Reference