REPLACE
Supported, behaves as documentedCategory: Text · Last tested 2026-07-04
Support matrix
| Engine | Documented | Live-tested | Verdict |
|---|---|---|---|
| Excel | Yes | Not yet | n/a |
| Google Sheets | Yes | Not yet | n/a |
| LibreOffice Calc | Yes | Yes (24.2.7.2, 2026-07-04) | Supported, behaves as documented |
Executed test cases
LibreOffice Calc 24.2.7.2 (tested 2026-07-04)
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =REPLACE("123456",1,3,"@") | Replaces the first 3 characters by position, regardless of what they are | @456 | @456 | Matched |
| =REPLACE("2009",3,2,"10") | Replaces characters at fixed positions 3-4 | 2010 | 2010 | Matched |
| =REPLACE("banana",2,3,"XYZ") | REPLACE targets characters purely by position (start_num/num_chars), unlike SUBSTITUTE which matches by content: here characters 2-4 ('ana') are removed and replaced with 'XYZ' regardless of what they spell | bXYZna | bXYZna 'banana' = b(1)a(2)n(3)a(4)n(5)a(6); removing positions 2-4 ('ana') and inserting 'XYZ' gives 'b' + 'XYZ' + 'na' = 'bXYZna' |
Matched |
| =REPLACE("abcdefghijk",6,5,"*") | Replaces a 5-character mid-string range (positions 6-10) with a single character | abcde*k | abcde*k | Matched |
Docs & syntax
- Excel: official documentation
- Google Sheets: official documentation
- LibreOffice Calc: official documentation