# 5.12 Pincodes आणि leading zeros असलेले codes

Source: https://ravindrabagale.com/mr/excel/ch05-data-cleaning-a-z/5-12-pincodes-and-codes-with-leading-zeros.html
Language: mr (Marathi with English technical terms)

आधीचा data

 | Store
 | Pincode (raw)
 | SKU (raw)

 | Kothrud
 | 411038.0
 | 4512

 | Gangapur Road
 | 422 013
 | 87

 | Sitabuldi
 | 440012
 | 1203

 | Hotgi Road
 | 41 3003
 | 9

Clean केल्यावर

 | Store
 | Pincode
 | SKU

 | Kothrud
 | 411038
 | 004512

 | Gangapur Road
 | 422013
 | 000087

 | Sitabuldi
 | 440012
 | 001203

 | Hotgi Road
 | 413003
 | 000009

भारतीय PIN code सहा digits चा असतो; leading zero नसतो. SKU किंवा employee code मध्ये मात्र zeros अर्थपूर्ण असू शकतात. म्हणून field चा business meaning समजून घ्या.

Steps

Sample pincode मधले spaces/.0 numeric formatting clean करून सहा-character display: =TEXT(VALUE(SUBSTITUTE(B2," ","")),"000000"). पण missing digit असलेल्या invalid PIN ला zero लावून valid समजू नका.

Fixed six-digit SKU standard असल्याचं ठरलं असेल तर raw SKU C2 पासून =TEXT(C2,"000000") करा. Output वेगळ्या column मध्ये ठेवा.

फक्त number padded दिसायला हवा असेल तर custom format 000000. यात underlying value numberच राहते.

Import वेळी Power Query / Text Import Wizard मध्ये code columns Text ठेवा, म्हणजे original zeros जात नाहीत.

Practice

Known six-digit SKUs restore करा. Spaces आणि .0 असलेले sample pincodes clean करा. दिलेल्या Pune sample list साठी =LEFT(C2,3)="411" हा expected-prefix check करून पाहा; हा सर्व Pune जिल्ह्याचा सार्वत्रिक नियम म्हणून वापरू नका.

रवींद्र बागले यांची tip

CSV double-click करून उघडल्यावर codes numeric बनू शकतात. Data › From Text/CSV मधून Text type स्पष्ट द्या. Format मध्ये zero दिसणं आणि text value मध्ये zero असणं वेगळं आहे; lookup च्या दोन्ही बाजूंचा type जुळवा.
