Ravindra BagaleCourses & study guides मराठी Track your progress

5. Data Cleaning A–Z

Excel

5.12 Pincodes and Codes with Leading Zeros

Keep leading zeros when the digits identify a record

A store receives a list of product keys that look like 00123. Somebody opens a CSV and sees 123. The inventory master still stores the original five characters. A colleague adds a number format and makes both visible values look like 00123, yet a lookup can still miss the record. To fix the workbook you need evidence about the stored characters, the data type and the source's identifier format.

We will use a fictional stock and fulfilment workflow inspired by Blinkit and Amazon Now. One lab treats 00123 as an invented five-character product key. The other covers the Indian Postal Index Number convention, which uses six digits. Its practice labels are from a deliberately small fictional routing list. The lab does not establish whether a value is currently usable for an address.

  • Preserve digit text. Set the type before input or import so that a real leading zero remains part of an identifier.
  • Know what formatting changes. Compare a numeric cell using a padding format with an actual text value.
  • Repair only with evidence. Rebuild a candidate if a verified source specification gives its width and numeric range.
  • Check against a source list. Keep a basic character check separate from an authoritative postal or product match.

Distinguish text content from a padded display

If you record 123 as an ordinary number, its value is 123. If you apply the custom number format 00000 where Excel supports it, it can display as 00123 while still being numeric. Text containing 00123 actually stores five characters. A formula that returns the text 00123 also keeps those characters in its result. Two identical grid displays can therefore represent different types.

Text stores the five characters 00123. A custom format can display the number 123 as 00123. TEXT with a confirmed width returns the distinct text 00123.
Check the actual type before matching the lookup key. Padding the screen display does not change a number into a stored identifier.

Choose the type based on how the value will be used

Use numeric storage for a measure you will add, compare numerically or multiply. The contents of a warehouse quantity field belong in that category. Use text for a stable code whose characters matter, such as an inventory key or a postal identifier. A numeric display format can be useful when a numeric sequence is merely presented with aligned width. Keep the underlying type consistent with what the receiving system expects.

Check the evidence instead of relying on alignment

Open a scratch sheet and compare three cells. Enter 123 as a number in L2. In L3 first set Text format and type 00123. In L4 enter =TEXT(L2,"00000"). Apply the numeric padding format to L2 if your Excel build allows it. All three can appear as 00123. ISNUMBER identifies L2 as numeric, while ISTEXT identifies the other two results as text. Select each cell to compare the actual content.

If you already lost leading zeros, adding Text format to the existing numeric cell does not supply them. Recover the original text from its source when possible. A known fixed-width rule can create a candidate, but it does not by itself prove which source record the original file intended.

Why can a number displayed as 00123 fail to match a stored text code?

The visible label can come from a display format while the cell still stores the numeric 123. Compare underlying types and characters in both the incoming data and the master.

Preserve code fields before Excel chooses a type

A CSV gives its data as text fields. Opening it directly can cause a spreadsheet to infer numbers, dates or scientific notation. For reliable code import, choose Text for identifier columns using the available import tools. Check which transformations are saved in an import query. A later automatic type change can undo a correct first interpretation.

Use a short test file with known characters

Choose a small synthetic file with 00123, 00007 and A0123. Read it using the same import process your team plans to use. Inspect the original CSV if you see a discrepancy. Verify that a leading zero still belongs to the cell value, that the field is text and that the alphanumeric control stays unchanged. Avoid converting the entire worksheet to one data type because quantity and price columns should still calculate.

A long code also needs an early text setting. Excel numeric storage has a fifteen-significant-digit precision limit. A generic sixteen-digit identifier stored numerically can lose meaningful digits. Applying TEXT after that loss cannot recover the exact original. Restore the verified value by importing it as text from the authoritative file.

Check what the next system receives

Keep the practice workbook in an Excel format while you prepare and audit its sheet. If a receiving process needs CSV, export the intended sheet or copy and inspect the literal output. Some receiving apps may infer types again on open. Confirm the field's stored characters in the receiving process. A successful Excel display test alone gives no evidence about that second import.

A 16-character identifier lost its final digit. Can a number format recover it?

No. A display format uses what Excel currently stores. Retrieve the verified original from the source and keep it as text before any type inference or numeric transformation.

Rebuild a fixed-width candidate only after checking the source rule

Some legacy files stored product keys as numbers even though a source specification guaranteed a known width. If the source confirms that every product key in one feed uses exactly five decimal digits, a preserved numeric 123 can be represented as a candidate with =TEXT(123,"00000"). The result is the text 00123. Verify it with the correct product master before treating it as an approved match.

Check the value before padding

Confirm that the input is numeric, nonnegative, an integer and within the declared width. The pattern 00000 sets a minimum width for this simple number formatting. It does not remove extra leading digits from 123456. A negative value or a fraction is outside our rule. Exclude or review it before padding. Once the result is prepared, check its type, length and intended characters.

For a compact text input already containing 00123, keep it as text. Avoid converting it to a number and then relying on a guessed display to restore it. A five-character contract for one product feed cannot decide what a three-character identifier 123 should become in an unknown feed. It could already be complete, or it might belong to a different supported width.

Can you assume numeric 123 means 00123 in every spreadsheet?

No. You need the source format before reconstructing a candidate. The same numeric value could have come from a short complete code or from several different widths with meaningful leading zeroes.

Trace a verified source width into a candidate

  1. Identify the raw field and its type

    The scratch legacy feed supplies numeric 123 for record SKU-03. The source originally permitted product keys under a documented five-digit rule.

  2. Verify the conversion's scope

    The value is a nonnegative integer within the allowed numeric range. An unknown feed with the same 123 stays on hold because its original width is missing.

  3. Create a text candidate

    Apply TEXT with the five-digit format. The helper writes 00123 while the raw number remains intact. Check the result's type and character length.

  4. Verify it in the key list

    Compare the text candidate with the reviewed product master. A matching code is one piece of evidence. Keep the raw ID and rule so the lookup has a traceable source.

Lab 1 · Preserve or reconstruct five-character product keys

Goal. Distinguish preserved text from a scoped numeric reconstruction. Add an editable scratch worksheet named Code Width. Put Record, Raw Code, Source Rule, Readiness and Candidate in A1:E1. This table deliberately contains mixed raw types for learning. Enter values marked as text with a leading apostrophe or using a cell explicitly formatted as Text before entry. Leave numeric controls as numbers.

Eight fictional inventory records and expected results
IDRawSource ruleExpected statusCandidate
SKU-0100123 as textVerified text5Keep text00123
SKU-0200007 as textVerified text5Keep text00007
SKU-03123 as numberVerified width5Rebuild candidate00123
SKU-04123 as numberUnknown widthHold ruleEmpty display
SKU-05A0123 as textVerified text5Review text shapeEmpty display
SKU-060000 as textVerified text5Review text shapeEmpty display
SKU-07Leave blankVerified text5MissingEmpty display
SKU-08123456 as numberVerified width5Review numeric rangeEmpty display
  1. Enter the exact field types. Put the strings and numbers from the table in B2:B9 without type descriptions. Use the source rule text exactly in C. Observe that a numeric 123 can appear on two rows with different evidence about its source.
  2. Check the story of each row. Under Verified text5, require text and five digits. Under Verified width5, require a valid integer in range. Unknown width cannot produce a candidate. Compare these intended outcomes before typing the status formula.
  3. Calculate the status. Put the D2 formula below in the sheet and fill down. For the ASCII-digit check on a five-character text input, compare its exact text with the numeric value formatted back to five digit positions. The IFERROR here handles the number parsing test. The raw value stays preserved.
  4. Build the output. Put the E2 formula below in the sheet and fill to E9. E2 and E3 preserve original text. E4 uses TEXT to create a candidate. The remaining records stay visible with their reason for review.
  5. Test the width boundary. In a scratch copy change the last numeric value from 123456 to 99999 and check its candidate. It should now have five digits under the verified width rule. Restore the original failing value after confirming the error check is effective.
D2 =IF(B2="","Missing",IF(C2="Verified text5",IF(AND(ISTEXT(B2),LEN(B2)=5,IFERROR(EXACT(TEXT(--B2,"00000"),B2),FALSE)),"Keep text","Review text shape"),IF(C2="Verified width5",IF(ISNUMBER(B2),IF(AND(B2>=0,B2<=99999,B2=INT(B2)),"Rebuild candidate","Review numeric range"),"Review numeric range"),"Hold rule")))
E2 =IF(D2="Keep text",B2,IF(D2="Rebuild candidate",TEXT(B2,"00000"),""))

Expected evidence. Eight original records yield three candidates and five without a candidate. Two rows share the text 00123, and their raw types and documented paths differ. If text 00007 appears as 7 in the raw column, restore the original field as text. If the unknown-width row gets filled, inspect the source condition rather than trusting the apparent five-character shape.

Apply the six-digit postal convention to the right field

The Indian Postal Index Number, commonly written PIN code in postal addresses, uses six digits. A five-digit product code such as 00123 is a different field. A six-character product code like 000451 can also be a valid code for its own stock system. India Post also describes a separate location-based identifier called DIGIPIN. Keep it in its own field when a source uses it. Applying a six-digit spreadsheet check to a different address field does not establish a postal error. Document which kind of identifier your import expects, then check its own source description. This prevents a team from fixing a supposed length issue by changing the field itself. Its width does not identify it as a postal PIN. Use column meaning and source evidence before applying any format formula.

Separate shape from a current postal reference

Testing six digit characters establishes a narrow shape requirement. It says nothing about the full address or whether the PIN is in an approved reference list. Use the current India Post lookup or a verified directory when actual assignment matters. A training worksheet or a small shop's service table can contain only a subset. An absent result in that subset is a report coverage issue until verified against the appropriate source.

India's postal PIN has six digits. 411001 and 999999 both have that character shape. Only the first appears in the lesson's partial mock routing list.
The second result shows why passing a character check provides no proof of coverage or validity for a real address.

Keep range type and record meaning stable

Import the reviewed reference codes as text and compare your candidate text with that same type. Avoid switching one side to a display-formatted number merely because it looks equal. Check a known key and one that is absent before relying on the regional table. If that lookup drives a service decision, confirm its current date, owner and coverage.

A six-digit value is absent from the mock routing list. What does that establish?

It was not present in that small list. To establish a postal assignment or a real address, verify the current trusted postal reference and the supplied address data separately.

Lab 2 · Check PIN shape and compare a mock routing reference

Goal. Preserve each original string, test a specific six-digit requirement and look up a known subset without claiming broader coverage. Add a scratch sheet named PIN Review. Put Record, Raw, Candidate, Shape Status and Mock Route in A1:E1. Set the raw field and reference key cells to Text before entry. The route labels in this exercise are fictional.

Seven rows, testing a limited two-key reference
RecordRawExpected candidateShapeMock route
PIN-01411001411001Matches shapeLane P
PIN-02400001400001Matches shapeLane M
PIN-03411 001411001Matches shapeLane P
PIN-040012300123Review shapeEmpty display
PIN-05999999999999Matches shapeNot in practice list
PIN-0612345A12345AReview shapeEmpty display
PIN-07Leave blankEmpty displayMissingEmpty display
  1. Set the fixture rule. The sample source states that ordinary spaces are display-only separators in this one PIN field. This allows us to convert the controlled 411 001 case to 411001. A different export might need its own validated spacing rule.
  2. Compare candidates. Use =SUBSTITUTE(B2," ","") in C2 and fill down. Keep the raw text in B. Do not pad the five-character code from another category; it is an intentional shape exception.
  3. Review the shape. Use the D2 formula below for the exercise's ASCII-digit check. It checks missing input and the expected length, then confirms a six-digit text representation. Modern editions with REGEXTEST can use a pattern such as ^[0-9]{6}$ instead of the numeric-format comparison.
  4. Build the partial mock reference. In M1:N1 enter Code and Mock Route. Put text 411001 and Lane P in M2:N2. Put text 400001 and Lane M in M3:N3. Use the E2 formula below only for shape-pass rows and fill down. FALSE requests an exact VLOOKUP rather than an approximate match.
  5. Check the counts. There are seven raw source records, four shape matches, two shape reviews and one missing. The four shape matches contain three routing results and one outside the practice list. Preserve the seven original rows.
D2 =IF(B2="","Missing",IF(LEN(C2)<>6,"Review shape",IF(IFERROR(EXACT(TEXT(--C2,"000000"),C2),FALSE),"Matches shape","Review shape")))
E2 =IF(D2="Matches shape",IFNA(VLOOKUP(C2,$M$2:$N$3,2,FALSE),"Not in practice list"),"")

Verify and recover. If 411001 visually matches but lookup fails, inspect text type on both sides, and the exact range in E. Check which candidate has an intentionally absent key before altering the mock list. If the five-digit record is padded to six, reverse the extra transformation and keep the input's category mismatch visible. Restore the fixtures and save or close the practice file.

Compare fixed-width transformations that look similar

A coworker suggests padding every short code by combining zeroes with the input and keeping the rightmost five characters. That can suppress evidence of a long or damaged input. For numeric 123 that method could give the expected 00123 under a verified five-digit contract. For 123456 it can return 23456, which is an entirely different code that might already exist in the master. The apparent five-character shape is a consequence of truncation.

Use a deliberate contrast in a disposable sheet

On two separate scratch rows test numeric 123 and numeric 123456. Compare =RIGHT("00000"&B2,5) with =TEXT(B2,"00000"). The first applies a fixed-length slice to the combined string. The second uses a minimum presentation width while retaining six digits for the larger value. Use the exercises to observe the differences. A verified reconstruction has a length and integer-range check before formatting. It keeps a longer invalid record visible for review.

Test two proposed expressions before applying a code rule
Raw numberRIGHT after paddingTEXT with five positionsUnder verified five-digit policy
1230012300123Candidate permitted
12345623456123456Review numeric range

Check a fractional number and an out-of-range number

Try numeric 12.6 in the same scratch area. A fixed decimal display without a fractional placeholder can round it. This may produce a result that looks like a five-digit code even though the source was not an integer. A valid recovery checks the integer condition before creating the candidate. Compare B with its INT result only on known numeric inputs, and ensure nonnegative and in-range checks match the source rule. Test 0 and 99999 when they are allowed by the specification.

The permitted numeric domain in Lab 1 includes zero. TEXT would represent that outcome as 00000. A master might intentionally reserve all-zero codes as sentinels, so a formatted shape alone cannot approve them for inventory use. Apply the separate master or business rule after the character check. If there is no source record to approve the candidate, preserve it as a reviewed possibility instead of inventing an identity.

Handle multiple verified code conventions explicitly

A multi-store report may receive the same numeric value from feeds with different identifier widths. An older source could define a five-digit product key while a second defines a six-digit warehouse reference. The number 123 can become text 00123 in one feed and 000123 in the other. The correct result depends on the verified source contract. A global five-digit replacement would silently change how the second source is interpreted.

Keep a source-to-rule table for the intended fields

Create a small control table with Legacy Product as one source and Warehouse Reference as another. Give the first a width of 5 and the second a width of 6. For a verified width in D2 and an approved numeric 123 in B2, =TEXT(B2,REPT("0",D2)) constructs the corresponding count of zero placeholders. Use the selected width after validating that it belongs to the intended source and that the value meets that code's rule. For this teaching test only widths 5 and 6 are approved.

Compare the outputs under both widths in separate rows. If the source is unknown, leave its row on hold rather than letting a missing width fall through to a default. Keep the original identifier and the source system in separate columns. If the same text can appear in more than one namespace, your lookup or grouping may need both the feed identity and the code. Agree on the key definition before combining the lists.

Check what changes when the source changes

Temporarily switch one approved test row from the five-digit rule to the six-digit rule. The candidate changes from 00123 to 000123 while the numeric 123 stays unchanged. Return to the original rule after comparing. Use a separate test row where no rule is identified. Neither a complete width nor a valid range test for other records gives permission to fill that missing input.

Two stores supply numeric 123 with different documented widths. Can you use a single padded key?

Keep each source rule and candidate separately. The verified widths produce different literal identifiers. Compare and combine them only after reviewing what each number identifies in its own dataset.

Prove that the candidate can be used as a lookup key

Return to Code Width. Suppose the verified practice inventory master stores text 00123 for Planner Pack and text 00007 for Pen Set. In M2:N3 store these keys and labels. Set the key cells to Text before typing. Use =IF(E2="","",IFNA(VLOOKUP(E2,$M$2:$N$3,2,FALSE),"Review inventory key")) in a spare output field and fill down. The expression looks up the prepared candidate only when it is present. It requests the second column and exact matching.

Compare the visible width with the actual value

SKU-01 and SKU-03 both produce the text 00123, so they should each retrieve Planner Pack. SKU-02 retrieves Pen Set. Now test the old raw number 123 in an otherwise identical spare lookup. It can fail to match the text stored in the master even if formatting displays it as 00123. Read ISTEXT on both input sides to see why a look-alike cell provides different key evidence.

If the master has two different product names for the same text key, a lookup that returns one value does not prove which record is correct. Check master uniqueness before comparing. For this small text example you can count current exact matches with =SUMPRODUCT(--EXACT($M$2:$M$3,E2)) on an approved nonempty candidate row. A count of one is expected in the training master. A missing or duplicated key needs its own review outcome.

Keep candidate repeats and source duplicates separate

The two source rows leading to 00123 are not automatically duplicated transactions. Many purchases can refer to the same product. An inventory report can count five shipments of one key while the product master itself has one row representing that product. Reconcile counts using the field that represents the report's grain. Check prepared code results and source record counts separately.

A concise handover can say “eight source records, three usable candidates, two distinct prepared product codes, five unresolved rows.” That report has enough detail to explain why distinct codes are fewer than prepared rows. If the invalid long-code test is resolved in the source, update the audit and verify which master key the newly approved candidate refers to before treating it as released.

Handle a confirmed export representation before the shape check

Some systems write an identifier through a numeric export step and produce a string that ends in .0. This can be an export convention or it can be a different value. Ask how the source generated the field. If the only representation available is a number that was already rounded or shortened, a worksheet cannot recover the original characters on its own.

Apply one documented change to one known fixture

In a disposable PIN scratch sheet, consider a source whose owner confirms that numeric internals serialize every integer key with the exact two-character suffix .0. For the verified test string 411001.0, =IF(RIGHT(B2,2)=".0",LEFT(B2,LEN(B2)-2),B2) can prepare the text 411001 in a helper. Run the six-digit shape check and the appropriate reference check afterward. Keep the original eight-character string and its evidence.

Now compare it with 411001.5. The exact suffix test leaves that value unchanged. It fails the six-digit requirement and needs review. Turning both strings into numbers and forcing a six-position format can round a fractional value into an apparently acceptable identifier. Do not round a routing code to reach a match. Ask for the exact key when the source is inconsistent.

Check the kind of source before treating punctuation as decorative

The PIN Review lab removed a space because its input contract explicitly said it was only presentation. The decimal fixture is a different source and a different verified rule. An unexpected dash, nonbreaking space or decimal mark can mean something else. Keep one documented transformation per supported version of the feed. If a file's format changes, test the boundary cases again before releasing a new import.

Decide whether to store a directory value, apply an agreed cleanup, or hold the record for review based on the evidence available. A checked reference match can support intended routing for the particular dataset. It does not verify all other address fields. Keep a status specifically tied to the trusted lookup you performed.

Reconcile every row before distributing the repaired data

Keep the initial values in a dedicated raw snapshot. This makes a correction traceable and gives you a way to recover the original data. Build a separate reviewed table for a downstream report. Include its source ID, approved code and status, then decide whether the recipient actually needs the input representation. Preserve the restricted source under the approved workflow.

Verify the expected groups after a correction

In Lab 1 there are two preserved text values and one reconstructed candidate. The remaining five records have distinct unresolved conditions. In Lab 2 there are three matches in the mock routing list, one outside it, two malformed shapes and one missing source. Each set of dispositions adds back to its entire raw row count. An ID-level check can also prove a record was not lost during export or replaced by a duplicate.

When testing a new source, review one already-correct code, one documented recovery, one oversized number and one missing value. Verify an official reference or the intended master on a known key. Copy only the reviewed output if you need a new reporting table. Compare its count and exact controlled strings with the selected records, especially the ones with meaningful zeroes.

Use comparison and type checks together

A worksheet can contain text that looks like a number and numeric cells that look like the intended IDs. Checking a match, a width or a displayed value alone leaves room for an interpretation error. Combine independent checks when the actual characters and data type are part of the receiving system's specification.

Compare the stored values in three cells

Return to the L2:L4 controls. L2 stores numeric 123, L3 stores literal text 00123 and L4 is the five-position TEXT calculation. Apply a padded number format to L2 or simply look at the formula bar if your current view does not support that format. For these controls LEN of L2 reads the normal text representation of 123 and returns 3. LEN of L3 and L4 returns 5. ISTEXT confirms L3 and L4 are text.

Use =AND(ISTEXT(L3),ISTEXT(L4),EXACT(L3,L4)) to verify the two text controls have the same characters. Expect TRUE. With L2 in place of L4, the text-type requirement fails. The separate type checks matter because functions can coerce arguments when evaluating a comparison. The exercise checks both the intended representation and the comparison result.

Preserve a legitimate mixed-character code

A source can define an alphanumeric code such as A0123 or a text key such as 1E05 whose letters matter. The five-digit inventory contract in Lab 1 rejects A0123. That outcome refers to this one rule. A separate alphanumeric source can keep the full string. When testing an Excel import, check a controlled example that could be interpreted as scientific notation and verify that it arrived as literal text. Prepare different validation for the fields with different meanings.

Do not remove the letter A from A0123 to get something that fits a numeric shape. That would create a different identifier in a namespace the source did not specify. Route it to the reported source when the declared field is five digits. If the input should be alphanumeric, preserve it exactly and compare it with the appropriate master. Review a control that would fail if an automatic conversion were accidentally applied.

Change the reference and keep the shape count stable

For a final independence check, add 999999 as a text key in M4 of the mock PIN Review reference and write Lane T in N4. Extend every lookup for that test to read the three configured keys. No raw address or candidate was edited. The prepared shape counts should remain four matches, two shape reviews and one missing input. Only the number of mock route matches changes.

Check the result that changed and a result that stayed fixed

PIN-05 now shows Lane T in the mock return. The route count for the exercise increases from three to four. PIN-04 still has a five-digit product-shaped string and remains Review shape. This comparison shows how separately maintained lookup evidence can change a route report without changing the source text or the six-digit condition. Restore the limited practice list and the original range before returning to the first answer table.

In a real delivery process, add a route only from an authorised source and document its effective date. Repeat the known-key and absence controls when the table changes. Be explicit about whether you checked a current postal assignment, an internal coverage rule, or a practice dataset. These three checks can answer different questions.

Run three quick checks on a new value

  1. Compare display and type. Apply a five-position visual format to the number 7 and compare it with literal text 00007. Check. The numeric display can present the same characters, while the formulas report different stored types.
  2. Test an excessive width. Apply the five-position TEXT format to numeric 123456 in a scratch cell. Check. The result keeps all six digits. A length check is still needed before accepting it as a five-digit code.
  3. Separate shape and lookup. Compare a matching six-digit example with one missing from the mock list. Check. They can both pass the shape rule, but only the known example has a mock route.

Check your understanding

1. Which field should preserve a literal code such as 00123?
  • A. An explicitly text field
  • B. A rounded amount
  • C. A blank field with a custom display

Answer A. The five characters are part of the identifier. Text preserves them through the cell's content rather than only in the visible format.

2. Does a custom number format change numeric 123 into text 00123?
  • A. Yes, on every Excel edition
  • B. It can show 00123 while storing the number 123
  • C. It always rounds 123 down to 0

Answer B. The numeric format handles appearance. Inspect the underlying value and type before using it in a text-key lookup.

3. When can a helper use TEXT to create a five-digit candidate from numeric 123?
  • A. Whenever the code looks short
  • B. Whenever the report is printed
  • C. When a verified rule gives five digits and the numeric value is suitable

Answer C. The format supplies a known width for a valid number. The original record and the verified source rule should still be retained.

4. How many digits are in the Indian Postal Index Number convention?
  • A. Six
  • B. Five
  • C. Any text length

Answer A. It is a six-digit postal convention. The five-character product key in the other lab is a separate fictional identifier.

5. What does a six-digit candidate outside the mock route list establish?
  • A. It proves the address cannot exist
  • B. It is absent from this limited list
  • C. It proves the input must be a product key

Answer B. The mock list is partial. A real assignment or delivery decision needs the appropriate verified source and the actual address.

6. What should happen when the original width is unknown?
  • A. Pad it to whichever width appears most often
  • B. Drop the input row
  • C. Preserve it and request the source rule

Answer C. Guessing can create an ordinary-looking value for the wrong record. A hold status keeps the information visible without inventing characters.

Interview questions with worked answers

How would you prevent losing leading zeros from a CSV import?

I identify which fields are literal identifiers, set them to Text before type conversion and verify an original control such as 00123. I keep the original file. I check the received data and its type instead of relying only on what an Excel column displays.

What is the difference between a numeric padding format and TEXT?

A numeric format changes appearance. TEXT produces a string according to the given format. A displayed 00123 in a numeric cell can still be numeric 123. I check what the master expects before using the value as a key.

Would you automatically pad all short codes to six characters?

I need a verified width and a valid source value before doing that. A short code can be complete under another source contract, a missing value or an entry error. I keep the raw input and label unresolved rows rather than treating one width as universal.

How do you check a postal code in a worksheet?

I confirm the country and field meaning, then apply the expected character rule. For India's postal PIN the defined width is six digits. I use a current trusted reference for actual assignment, and keep shape and directory coverage as separate checks.

How do you audit a fixed-width recovery?

I preserve the raw field, record the verified source width, build a separate text candidate and check the master. I count kept, reconstructed and unresolved records, and test an out-of-range value and one already-correct key before applying the transformation to a wider file.

Quick recall cards

  • Identifier text

    Keep meaningful characters such as initial zeros before import or entry.

  • Numeric format

    Changes how a number looks. It keeps the underlying cell numeric.

  • TEXT

    Returns a formatted string. Rebuild only under a verified width and valid value.

  • PIN shape

    India's postal PIN uses six digits. A shape check needs separate reference evidence.

  • Same lookup type

    Compare the candidate and master using the intended data type and exact values.

  • Keep the raw source

    Document the rule, original record, candidate and unresolved result.

The next lesson extracts parts of text. Keep the same evidence-led approach. A prefix or section of a code can be useful when the input format is stable and documented, and unexpected formats need their own review.

Official references

Continue practising: explore the existing Excel Task Hub for additional exercises.