Excel REPLACE Function
Chala mitrano — rEPLACE edits by position. Start here, remove N letters, drop new text in.
चला मित्रांनो — REPLACE position ने दुरुस्ती करते. इथून सुरू, N अक्षरे काढा, नवीन text टाका.
चलो दोस्तों — REPLACE position से ठीक करता है. यहाँ से शुरू, N अक्षर हटाओ, नया text डालो.
Purpose
Replace characters at a fixed position with new text — by start and length, not by matching words.
Return value
Text after the positional replacement.
Syntax
Arguments
| Argument | Required? | Description |
|---|---|---|
old_text | Required | Original text. |
start_num | Required | 1-based start of the part to overwrite. |
num_chars | Required | How many characters to remove before inserting new_text. |
new_text | Required | Text to insert at that spot. |
Version
All Excel versions. LibreOffice Calc compatible.
How to use — Why → What → How
Why: Pune HR shows only last 4 of an employee code on printed badges. Frankfurt payroll masks IBAN display the same way. REPLACE edits by known positions. Positional REPLACE is for masks and fixed-width fixes. Stress privacy: fictional IDs only. Sketch character positions on paper before typing start_num.
What: REPLACE removes num_chars characters starting at start_num and inserts new_text there. Unlike SUBSTITUTE, it does not search for a word. Read every argument in the table once before you type; each one changes the answer on purpose.
How — numbered steps:
- Type =REPLACE(A2,1,8,"**** **** ").
- Confirm start and length on paper first.
- Fill down for a badge list.
- Combine with RIGHT to keep the visible tail.
- Never use real sensitive IDs in practice files.
Ravindra Bagale's Tip
Friends, masking Aadhaar-style display (fictional) uses REPLACE to keep last 4 and star the rest — never store real Aadhaar in class files.
Ravindra Bagale's Tip – मराठी
मित्रांनो, display masking साठी REPLACE — शेवटची 4 ठेवा, बाकी star (class मध्ये खरे Aadhaar ठेवू नका).
Ravindra Bagale's Tip – हिंदी
दोस्तों, display masking के लिए REPLACE — आखिरी 4 रखो, बाकी star (class में असली Aadhaar न रखो).
Ravindra Bagale's Tip
Friends, sleep on REPLACE and rebuild example 1 tomorrow without looking. That five-minute test beats rereading the whole page.
Ravindra Bagale's Tip – मराठी
मित्रांनो, REPLACE वर एक रात्र झोपा आणि उद्या उदाहरण 1 न पाहता पुन्हा लिहा. पाच मिनिटांची ही चाचणी पूरे पृष्ठ वाचण्यापेक्षा जास्त मदत करते.
Ravindra Bagale's Tip – हिंदी
दोस्तों, REPLACE पर एक रात सोकर कल उदाहरण 1 बिना देखे फिर लिखो. पाँच मिनट का यह टेस्ट पूरा पेज पढ़ने से ज़्यादा मदद करता है.
Ravindra Bagale's Tip
Friends, after you finish REPLACE, open yesterday’s real workbook and find one place this function would have saved ten minutes. That habit turns lessons into salary skills.
Ravindra Bagale's Tip – मराठी
मित्रांनो, REPLACE शिकून झाल्यावर कालची खरी वर्कबुक उघडा आणि शोधा जिथे हे फंक्शन दहा मिनिटे वाचवू शकले असते. ही सवय धड्यांना पगाराची कौशल्ये बनवते.
Ravindra Bagale's Tip – हिंदी
दोस्तों, REPLACE सीखने के बाद कल की असली वर्कबुक खोलो और ढूँढो जहाँ यह फ़ंक्शन दस मिनट बचा सकता था. यही आदत पाठ को सैलरी स्किल बनाती है.
Download practice file: practice-replace.xlsx (includes sheet About this data, practice sheets, and Answers).
Worked examples
1) Mask front
Pune badge (fictional codes).
| EmpCode |
|---|
| EMP123456789 |
| EMP987654321 |
Result: ********6789
What it means: Front masked.
2) Fix year in code
Frankfurt batch code.
| Batch |
|---|
| DE-2024-091 |
| DE-2024-092 |
Result: DE-2026-091
What it means: Year becomes 2026.
3) Insert by replacing 0 chars
Insert marker.
| Code |
|---|
| ABCDE |
Result: AB-CDE
What it means: AB-CDE — zero removed, hyphen inserted.
4) With RIGHT
Show last 4 only style.
| EmpCode |
|---|
| EMP123456789 |
Result: *******6789
What it means: Stars then last 4 (pattern).
5) Shorten middle
Remove two chars.
| Code |
|---|
| AAXXBB |
Result: AABB
What it means: XX removed.
6) € label tweak
Currency tag.
| Label |
|---|
| AMT-EUR-100 |
Result: AMT-€-100
What it means: EUR → €.
Common errors and fixes
Notes and tips
- Positional, not search-based.
- num_chars 0 inserts without deleting.
- Keep practice IDs fictional.
- Badge printing in Pune and IBAN display rules in Frankfurt both need positional edits. Stress privacy: fictional data only in class.
- REPLACE vs SUBSTITUTE: position vs search. REPLACE vs MID: MID extracts; REPLACE rewrites.
- Fictional sample data only — practice amounts and names are made for learning.
- After the 10 tasks, re-read the errors table once.
- Say the business question in plain words before you type equals.
- Keep a scrap sheet for experiments so you do not overwrite class files.
- Fill formulas down only after the first row looks correct.
- When two answers look possible, write both on paper then test in Excel.
- Positional REPLACE is for masks and fixed-width fixes. Stress privacy: fictional IDs only. Sketch character positions on paper before typing start_num.
- Revisit the REPLACE errors table after the quiz — most classroom mistakes are listed there.
- Build one brand-new example on a blank sheet from memory before you close the laptop.
- If a result looks wrong, check spaces with LEN and case with exact equals before changing the formula.
- Share one tip from this page with a classmate in Marathi or Hindi — teaching locks the idea.
- Keep currency symbols consistent inside a single report column even when practice mixes ₹ $ £ € across examples.
- When Excel versions differ at home and in class, write the fallback formula under the modern one in a comment cell.
- Print the revision card for REPLACE and stick it near your monitor for one week of real worksheets.
- When helping a junior, ask them to predict the result before pressing Enter — prediction builds judgement.
- Keep a personal notebook of the one mistake you make most often with this function; review it monthly.
In real work
Badge printing in Pune and IBAN display rules in Frankfurt both need positional edits. Stress privacy: fictional data only in class. Positional REPLACE is for masks and fixed-width fixes. Stress privacy: fictional IDs only. Sketch character positions on paper before typing start_num. Classroom drill: write three brand-new REPLACE formulas on a blank sheet using names from your own city — if you can invent them without the page open, you own the skill. Then break one formula on purpose (wrong case, wrong start, extra space) and watch the error; recovering from that break is half of interview readiness.
How it compares
REPLACE vs SUBSTITUTE: position vs search. REPLACE vs MID: MID extracts; REPLACE rewrites.
Interview corner
- Search or position?
- Position.
- Insert without deleting?
- num_chars 0.
- Sensitive data in class?
- Always fictional.
Related functions
SUBSTITUTE, MID, LEFT, RIGHT
Practice tasks (10)
- Task 1. Mask first 8 of EMP123456789.Hint: start 1.
- Task 2. Change 2024 to 2026 in DE-2024-091.Hint: start 4 length 4.
- Task 3. Insert hyphen with num_chars 0.Hint: ABCDE demo.
- Task 4. Remove XX from AAXXBB.Hint: start 3 length 2.
- Task 5. Note privacy rule for class files.Hint: fictional only.
- Task 6. Fill masks for two emp codes.Hint: fill down.
- Task 7. Compare REPLACE vs SUBSTITUTE in a sentence.Hint: position vs search.
- Task 8. Sketch positions on paper before formula.Hint: avoid miscount.
- Task 9. € label tweak example.Hint: example 6.
- Task 10. Interview: insert without delete?Hint: 0.
Quick quiz
Answers: Q1=Position, Q2=Insert only, Q3=1, Q4=SUBSTITUTE, Q5=Fictional (check after you try).
Revision card
Standalone card (no tip or photo strip). QR opens this lesson. Download the PNG and revise offline.