Medium: VLOOKUP column index off-by-one
Someone inserted a Region column. VLOOKUP still uses col_index_num=2, so FX-20 returns “West” instead of ₹1450. Change the index to 3 (LibreOffice: broken West, fixed 1450).
Region column insert झाल्यावर VLOOKUP अजून col_index=2 वापरते — FX-20 साठी “West” येते, rate नाही. Index 3 करा.
Region column insert के बाद भी VLOOKUP col_index=2 पर है — FX-20 के लिए “West” आता है, rate नहीं। Index 3 करें।
Why → What → How
Why: Inserting a column silently breaks every VLOOKUP that hard-coded col_index_num.
What: Four freight codes. Broken B11 → West. Fixed B11 → 1450 (LO verified).
How:
- Open sheet Rates.
- See VLOOKUP return Region text.
- Count columns: Code=1, Region=2, Rate=3.
- Set col_index_num to 3, FALSE.
Ravindra Bagale’s Tip
Prefer INDEX+MATCH or Tables with structured refs so inserts hurt less.
Ravindra Bagale’s Tip – मराठी
INDEX+MATCH किंवा Table structured refs inserts नंतर सुरक्षित.
Ravindra Bagale’s Tip – हिंदी
INDEX+MATCH या Table structured refs inserts के बाद सुरक्षित।
Bugs explained (with mini examples)
Bug 1 — Stale col_index_num
Bug 2 — No test after schema change
Practice tasks (12)
- Task 1. What does broken B11 show for FX-20?Hint: West.
- Task 2. What should the rate be?Hint: 1450.
- Task 3. Why did col_index 2 break?Hint: Region inserted.
- Task 4. Write the fixed VLOOKUP.Hint: …,3,FALSE
- Task 5. Change lookup to FX-10 — expect 1200.Hint: Yes.
- Task 6. Interview sentence.Hint: “Col index not updated after insert.”
- Task 7. Would MATCH for Rate header help?Hint: Dynamic index.
- Task 8. Try approximate match TRUE here?Hint: No — codes exact.
- Task 9. Name columns 1–4.Hint: Code Region Rate Notes.
- Task 10. Add FX-50 row — extend range.Hint: $A$5:$D$9.
- Task 11. Bonus: INDEX+MATCH on Rate.Hint: INDEX Rate, MATCH code.
- Task 12. Document schema change in a note.Hint: A13.
In-browser formula check
Type the fixed formula you would put in the named cell. We check formula text — open the workbook for full recalculation.
Step-by-step solution (try first)
- Set col_index_num to 3.
- FX-20 → 1450. LO: broken West, fixed 1450.
Quick quiz