SheetRocks
Documentation/Formulas/ONCHANGE

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)
A
1 Initial Value

Track range modifications

=ONCHANGE(A1:A3, "Unchanged", "Data Modified!")
Result ⇒ Unchanged (until range changes)
A
1 10
2 20
3 30

Conditional calculation on change

=ONCHANGE(A1, 0, SUM(B1:B10))
Result ⇒ 0 (until A1 changes, then calculates sum)
A
1 Value

Related Functions

Other Special Functions & Keywords functions:


← Back to Formula Reference