Replaces part of a text string with a different text string based on the number of characters you specify.
ฟังก์ชันนี้ทำงานใน Google Sheets เหมือนกับใน Excel — ไวยากรณ์และอาร์กิวเมนต์เดียวกัน
REPLACE(old_text, start_num, num_chars, new_text)The REPLACE function is used to swap a specific portion of a text string with new text. It is particularly useful for cleaning data or formatting strings by targeting character positions rather than specific content.
=REPLACE("2023-01", 1, 4, "2024")ผลลัพธ์: 2024-01
Replaces the first 4 characters ('2023') with '2024'.
REPLACE swaps text based on position, while SUBSTITUTE swaps text based on matching content.