=REPLACE(old_text, start_num, num_chars, new_text)One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
Need more than a single REPLACE formula? Try our free AI for Excel — it reads your entire spreadsheet, answers questions in plain English, and builds charts and analysis in the same chat.
old_text:
The original text string that you want to modify.
start_num:
The position in the old_text where the replacement will begin. The first character in the string is position 1.
num_chars:
The number of characters in the old_text that you want to replace, starting from the start_num.
new_text:
The text that will replace the specified characters in the old_text.
The REPLACE function in Excel is a versatile tool that allows you to substitute part of a text string with another text string. It is particularly useful when you need to modify specific characters or segments of text within a cell, making it easier to clean up or format data.
In simpler terms, the REPLACE function helps you change specific parts of text based on their position, allowing for efficient text manipulation.
Imagine you have a list of product codes in an Excel spreadsheet, and you need to update the codes to reflect a new format:
| Product Code |
|---|
| ABC-1234 |
| DEF-5678 |
| GHI-9101 |
| JKL-1121 |
| MNO-3141 |
You want to replace the first three characters of each product code with "XYZ".
To update the product codes, you would use the REPLACE formula as follows:
=REPLACE(A2, 1, 3, "XYZ")When you apply the formula to the first product code, it changes "ABC-1234" to "XYZ-1234". If you drag the formula down to apply it to the other product codes, the output would be:
| Updated Product Code |
|---|
| XYZ-1234 |
| XYZ-5678 |
| XYZ-9101 |
| XYZ-1121 |
| XYZ-3141 |
Here, all product codes have been updated to reflect the new format.
The REPLACE function is particularly useful when you need to standardize or modify text data without having to manually edit each entry. It allows for quick and efficient text changes, saving time and reducing errors.
Understanding how to use the REPLACE function can significantly enhance your data management capabilities in Excel, enabling you to efficiently manipulate and format text data.
Happy replacing!
You have a list of product codes in Column A that include a mix of letters and numbers, but you need to standardize them by replacing a specific character (e.g., replacing "X" with "Y"). You can use the REPLACE function to modify the product codes efficiently. This allows for consistent formatting across your inventory, making it easier to manage and track products without manually editing each entry.
Beyond the REPLACE function: Better Analyst is a full Excel AI that goes well past individual formulas. Upload any spreadsheet and ask questions in plain English — you'll get formulas, data analysis, and charts back in seconds. It's a free AI Excel assistant that works with any .xlsx, .xls, or .csv file — no plugins, no Microsoft 365 required.
Don't have a spreadsheet yet? Use our free AI spreadsheet generator to turn a text prompt into a downloadable Excel file — a full AI Excel sheet maker that builds headers, columns, and formulas from your description.
Create a free account for formula help, explanations, and spreadsheet analysis. Usage limits depend on your plan.
Browse our complete library of Excel formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.