Skip to content
Astera Technology

Replace one repeated word in a Calc report label

Use an occurrence input to change one literal substring.

Download complete case notes and answer keys ↓

Work with the example

Can you change only the second draft in this review label? A5 holds draft / draft / final and B5 chooses occurrence 2. C is the proposed display; A remains the original. D shows what happens when all occurrences are replaced.

Supplied exercise data
FormulaBaseline output
SUBSTITUTE(A5;"draft";"review";B5)draft / review / final
No occurrence argumentreview / review / final

Edit the working cells

Set B5 to 1: C5 becomes review / draft / final. A fresh B5=3 leaves draft / draft / final unchanged because only two matches exist. A6 holds drafting / draft; replacing its second draft gives drafting / review.

Check the failure case

SUBSTITUTE matches a substring, not a whole word. Replacing the first draft in A6 changes drafting to reviewing. An unchanged output at occurrence 3 does not confirm that a requested edit happened.

Which argument distinguishes one replacement from replacing every match?

Show the worked answer

The occurrence argument: B5 in the working formula.

Example files

Related resources