5.9 Merging Columns
Before
| Area | City | Platform |
|---|---|---|
| Baner | Pune | Blinkit |
| Tarabai Park | Kolhapur | Amazon Now |
| Nirala Bazar | Sambhaji Nagar | Blinkit |
After
| Store Label |
|---|
| Blinkit – Baner, Pune |
| Amazon Now – Tarabai Park, Kolhapur |
| Blinkit – Nirala Bazar, Sambhaji Nagar |
Steps in Excel
=C2&" – "&A2&", "&B2- Or
=TEXTJOIN(", ",TRUE,A2,B2)for "Area, City" skipping blanks (Excel 2019+). - Or Flash Fill: type the first label › Ctrl + E.
- Keep the original columns; the merged label is for display. Never use Merge & Center to "merge columns" – it keeps only the top-left value.
Ravindra Bagale's Tip
Many students think "merge" means Merge & Center – but that keeps only one cell and deletes the rest of the data! To join columns, use & or TEXTJOIN. And if you will use the merged label as a key, join the TRIMmed values, otherwise the lookup won't match.
Ravindra Bagale's Tip – मराठी
बरेच students "merge" म्हणजे Merge & Center समजतात – ते फक्त एक cell ठेवतं आणि बाकी data delete करतं! Columns जोडण्यासाठी & किंवा TEXTJOIN वापरा. आणि merged label key म्हणून वापरणार असाल तर TRIM केलेल्या values जोडा, नाहीतर lookup match होत नाही.
Ravindra Bagale's Tip – हिंदी
बहुत से students "merge" का मतलब Merge & Center समझते हैं – वह सिर्फ़ एक cell रखता है और बाकी data delete कर देता है! Columns जोड़ने के लिए & या TEXTJOIN इस्तेमाल करो. और merged label को key बनाना हो तो TRIM की हुई values जोड़ो, वरना lookup match नहीं होगा.
Practice task
Create a "Store Label" column for all stores. Then create a unique key StoreID|Date for each order row, e.g. =G2&"|"&TEXT(B2,"yyyymmdd").