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
- CSV - Serializes a table to a high-precision CSV string (CRLF between rows). Trailing empty rows and columns are cropped; internal blanks are kept. Wrap the cell or increase row height to see every line.
- FROMCSV - Parses a high-precision CSV string into a spilled table. Inverse of CSV.
- FROMTAG - Extracts a field value from a single JSON tag object produced by TAG or TAGS spillover.
- 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
- TAG - Converts a 2-column key|value table (default) or 2-row key|value table into a single JSON tag object.
- 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