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

5. Data Cleaning A–Z

Excel

5.13 Extracting Parts of Text

Turn a familiar note into fields you can use

A support analyst receives a note that reads “Order BLK-260314-001 delivered in 9 mins.” A person can see an order ID and a delivery duration at a glance. A worksheet cannot average the sentence as a measure. It needs a column for the ID and a separate numeric column for minutes. The challenge is to extract the right characters without guessing what an unfamiliar note means.

This lesson uses fictional delivery notes inspired by Blinkit and Amazon Now. The example notes, IDs and times are made up. The first lab extracts an ID and duration from a controlled note pattern. The second extracts a rider name, an order ID and a clock time, then checks the expected field boundaries.

  • Preserve source notes. Assign a row ID and keep original text before preparing separate fields.
  • Choose a boundary technique. Use fixed positions when the contract promises them, or verified text markers when field lengths can vary.
  • Convert only measures. Preserve the identifier as text and convert verified numeric or time parts separately.
  • Keep unusual notes visible. Mark missing markers, unsupported units and inconsistent values for review.

Choose between a fixed slice and a delimiter

LEFT reads characters from the start of a string. RIGHT reads from the end. MID reads from a given character position. The first character is position 1. For a file that always starts with “Order ” followed by a 14-character ID, =MID(A2,7,14) returns that ID. The first six characters are the letters of Order and a space. This works because the source provided a position and width contract.

Order BLK-260314-001 delivered in 9 mins is split using markers. Keep BLK-260314-001 as a text ID and convert 9 to numeric minutes.
Mark the exact boundaries on one known note before copying the calculation to all rows.

Check the width assumption on a longer identifier

In a second note the ID is BLK-260314-0112, with four digits in its last segment. A fixed 14-character slice would stop early. The result can still resemble a real ID, so there may be no Excel error to investigate. A delimiter is text marking a boundary. Use the space and phrase before “delivered in” to identify the end of the ID if the note contract permits varying lengths.

Both approaches are useful in specific situations. A documented 14-character fixed-width export can be parsed with positions, and a stable note phrase can support a variable-width substring. Inspect one genuine example from each source before choosing. A method that works on the first two rows can still fail for a different length or format.

What can go wrong when MID always extracts 14 characters?

A longer identifier can be truncated and a shorter one can include the next part of the note. Test the range of widths promised by the source and choose a method appropriate for that contract.

Find complete marker phrases before computing length

FIND locates text and returns its starting position. In the sample, the marker " delivered in " includes spaces as part of its structure. To extract the ID, start after "Order " and end immediately before the marker. To extract minutes, start just after the marker and stop immediately before " mins". The distance between the two boundaries tells MID how many characters to return.

Read the subtraction as end minus start

For the minutes field, call the first character of the measurement its start. The space before mins is the first character outside the measurement. Its position minus the start gives the number of characters to extract. If the marker begins at position 36 and the minutes start at 35, the length is 1. If a later note contains a three-character number, the same boundary calculation returns length 3.

Use the starting position argument to look for the unit marker after the content marker. If an unrelated part of the note also mentions the same unit, the first global match may come from the wrong phrase. Find the complete intended structure or review an ambiguous record. Keep examples where a required marker is missing and where it occurs outside the expected section.

Choose how the source handles case

FIND is case-sensitive. SEARCH can find letters without regard to case, and it has wildcard behaviour for certain patterns. A source that promises exact labels should use the appropriate exact marker. If uppercase ORDER and Order are both allowed, agree how to handle them and test both explicitly. Lowercasing the whole note to locate a marker can change the case of the order ID or rider name if you extract from that modified text. Use positions derived from an agreed comparison while preserving the desired original field characters.

Why do you search for the closing marker after the opening marker?

It restricts the search to the part of the note that can actually contain the field. A marker appearing elsewhere does not necessarily define the intended end of this field.

Keep an identifier as text and a duration as a measure

The ID BLK-260314-001 is an identifier. Its punctuation and zeroes belong to that text. The minutes read from the note also begin as text because MID returns text. For a reviewed plain numeric minutes field, VALUE converts that field into a number. Then a numeric total or average can use it. Do not apply VALUE to the whole ID.

Check the number and its unit before using it

A text marker can describe whether a value is written in mins, hrs or seconds. The first lab expects minutes only. A note containing 12 hrs should be held. Removing the unit and treating the remaining number 12 as minutes would change the measurement. If you later support hours explicitly, add a documented conversion and test it with a controlled fixture.

VALUE can parse more than plain whole digits, depending on the text and Excel's settings. In this example the source writes ordinary numeric minutes. Test conversion success and an integer range. If you must require only ASCII digits, use an explicit digit check or a supported regular expression in a separate step. The parsed field still needs a rule that makes sense for the receiving report.

Can numeric conversion be used to remove leading zeroes from the extracted ID?

The ID is a key, so keep it as text unless the reviewed source specification says otherwise. Convert the separate verified measurement so you can calculate with it.

If the reporting team needs the final ID segment as a separate text field, use the documented delimiter instead of truncating to three characters. In a supported build, =TEXTAFTER(D2,"-",-1) can return the text after the final dash. It produces 001 for the first example and 0112 for the longer one. Check an ID that contains no dash or ends in a dash before applying that rule to a production field. The suffix can appear in more than one order ID, so keep the complete original lookup key too. Retain the suffix only for a report with that defined field.

Trace a note into an ID and a number

  1. Read and preserve the original

    Keep the complete note for the sample ID. Find the beginning “Order ” phrase and the middle “ delivered in ” phrase without altering the source.

  2. Extract the identifier

    Take the characters after Order and before delivered. The result is BLK-260314-001. Its final 001 is part of the identity.

  3. Extract and test the duration

    Take the text between the two measurement markers. It reads 9 with the unit mins. Convert the verified text into the numeric value 9.

  4. Record review evidence

    Compare the ID and numeric duration to the raw note. If either boundary or unit is unexpected, keep the row for review rather than producing a guessed output.

Lab 1 · Extract a variable-width order ID and numeric minutes

Goal. Locate stable phrases, build two separate fields and prove your parser handles new widths. Create an editable scratch worksheet called Delivery Notes. Put Raw Note, Middle Marker, Unit Marker, Order ID, Minutes Text, Numeric Minutes and Review Status in A1:G1. Add the following seven fictional notes from row 2 and retain the original values.

Delivery Notes test fixtures
Raw noteExpected IDNumeric resultStatus
Order BLK-260314-001 delivered in 9 minsBLK-260314-0019Ready
Order AMN-260314-006 delivered in 10 minsAMN-260314-00610Ready
Order BLK-260314-005 delivered in 18 minsBLK-260314-00518Ready
Order BLK-260314-0112 delivered in 125 minsBLK-260314-0112125Ready
Order AMN-260314-008 delayed in 14 minsEmpty displayEmpty displayReview order boundaries
Order BLK-260314-009 delivered in pending minsBLK-260314-009Empty displayReview minutes
Order BLK-260314-010 delivered in 12 hrsBLK-260314-010Empty displayReview minutes
  1. Find the start of the middle and unit markers. Enter B2 and C2 from the formula list and fill down. A zero shows that the required marker was unavailable. C searches only after the middle marker. Confirm that the delayed-in row reports no middle marker.
  2. Extract the ID. Enter D2 and fill down. The ID is only prepared when the note starts with the required exact phrase and there is room for a nonempty value before the middle marker. Compare the fourteen- and fifteen-character IDs.
  3. Extract the measurement string. E checks both an order ID and a unit marker after the field start. It also verifies that the unit marker begins at the expected end position for this strict note sample. The lab does not accept extra comments after mins. Change that rule only with a verified source format.
  4. Convert and review. F converts the measurement string when present. G labels the row from its actual evidence. For an unexpected unit or nonnumeric result, leave the numeric output empty and keep the reason visible.
  5. Check the numbers and keep the control. The four ready values sum to 162 and average 40.5. There are three rows with no usable numeric result. The 125-minute row is a documented observation in this lab. It is longer than the others and can still be captured by the parser.
B2 =IFERROR(FIND(" delivered in ",A2),0)
C2 =IF(B2=0,0,IFERROR(FIND(" mins",A2,B2+LEN(" delivered in ")),0))
D2 =IF(AND(EXACT(LEFT(A2,LEN("Order ")),"Order "),B2>LEN("Order ")+1),MID(A2,LEN("Order ")+1,B2-LEN("Order ")-1),"")
E2 =IF(AND(D2<>"",C2>B2+LEN(" delivered in "),C2=LEN(A2)-LEN(" mins")+1),MID(A2,B2+LEN(" delivered in "),C2-B2-LEN(" delivered in ")),"")
F2 =IF(E2="","",IFERROR(VALUE(E2),""))
G2 =IF(A2="","Missing",IF(D2="","Review order boundaries",IF(ISNUMBER(F2),IF(AND(F2>=0,F2=INT(F2)),"Ready","Review minutes"),"Review minutes")))

Verify and recover. If an unsupported unit still yields a number, inspect the unit marker and make sure the source note ended in the agreed phrase. Use only rows labelled Ready when calculating the report's numeric total. A numeric conversion may produce an out-of-policy candidate before G flags it. Keep raw notes and parsed candidates separately. Save the restored scratch copy or close it when finished.

Lab 2 · Extract a clock time from a rider note

Goal. Read names with more than one word and convert a verified clock string. Use a blank worksheet named Rider Notes. Put Record, Raw Note, Rider, Order ID, Clock Text, Hour, Minute, Time Value and Status in A1:I1. The examples use a fixed note pattern of “Rider [name] delivered [ID] at [clock]” and a 24-hour clock.

Rider Notes input controls and expected statuses
IDRaw noteExpected riderTimeStatus
RN-01Rider Raja delivered BLK-260314-007 at 19:51Raja19:51Ready
RN-02Rider Zoya Shaikh delivered AMN-260314-006 at 08:05Zoya Shaikh08:05Ready
RN-03Rider Aarti delivered BLK-260314-0112 at 00:00Aarti00:00Ready
RN-04Rider Sam delivered BLK-260314-010 at 25:00SamEmpty displayReview clock
RN-05Rider Ira delivered BLK-260314-012 at pendingIraEmpty displayReview clock
RN-06Rider Noor picked up BLK-260314-015 at 10:00Empty displayEmpty displayReview boundaries
  1. Extract the three text fields. In a supported build use C2:E2 below. The TEXT functions use phrases rather than a fixed name or ID length. The pattern requires the Rider prefix and the delivered marker. It permits a multiword name.
  2. Read the two clock components. In F2 and G2 enter the helper expressions. The format must be five characters with a colon in the third position. The two halves should produce numeric hour and minute fields when they match.
  3. Validate before creating the time value. Put the H2 and I2 formulas in place. H needs a nonempty rider and order ID, integer clock parts in the allowed range, and exact two-digit source expressions. Expect a numeric zero for midnight in RN-03, which displays as 00:00 when the cell is formatted as time. It still counts as numeric.
  4. Fill and test failures. Fill the expressions down to row 7. A 25-hour source field fails the range check, even though TIME used directly could normalise it. A note without the delivered marker cannot supply an eligible delivery record. Review its source before deciding whether it belongs in the report.
  5. Use a compatible extraction route if needed. When TEXTBEFORE or TEXTAFTER is unavailable, locate the complete delivered and at markers using FIND as in Lab 1. Select the text between those positions with MID, and read the clock after at. The clock validation process stays the same.
C2 =IF(EXACT(LEFT(B2,6),"Rider "),IFERROR(TEXTBEFORE(TEXTAFTER(B2,"Rider ")," delivered "),""),"")
D2 =IFERROR(TEXTBEFORE(TEXTAFTER(B2," delivered ")," at "),"")
E2 =IFERROR(TEXTAFTER(B2," at "),"")
F2 =IFERROR(IF(AND(LEN(E2)=5,MID(E2,3,1)=":"),--LEFT(E2,2),""),"")
G2 =IFERROR(IF(AND(LEN(E2)=5,MID(E2,3,1)=":"),--RIGHT(E2,2),""),"")
H2 =IF(AND(C2<>"",D2<>"",ISNUMBER(F2),ISNUMBER(G2)),IF(AND(F2>=0,F2<24,G2>=0,G2<60,EXACT(TEXT(F2,"00"),LEFT(E2,2)),EXACT(TEXT(G2,"00"),RIGHT(E2,2))),TIME(F2,G2,0),""),"")
I2 =IF(B2="","Missing",IF(OR(C2="",D2=""),"Review boundaries",IF(ISNUMBER(H2),"Ready","Review clock")))
08:05 passes because hour 8 and minute 5 are permitted. 25:00 fails because hour 25 is outside the ordinary range 0 to 23.
Validate the supplied clock before building a real time value. TIME can normalise an out-of-range hour.

Verify and recover. The sample has three ready times, two invalid clock strings and one unsupported note pattern. Check that a valid midnight result is kept. If a time looks like a decimal number, apply a time display after checking the numeric result. Confirm that the reported source unit is a clock within the day, rather than a duration measured in hours.

Keep a review status when extraction is incomplete

Separate parsed evidence from released measurements

A source note might have a usable ID and no verified minutes. Retain the partially prepared record with a review status. If the report expects only usable durations, make a separate numeric output that reads the helper only when Status is Ready. For the first lab =IF(G2="Ready",F2,"") can serve that purpose. Count the ready numeric cases and all source rows separately.

Missing fields may still be useful for follow-up, so show the appropriate case count with the result. A row marked Review minutes can go back to the source by its ID if the ID was parsed reliably. When the boundaries fail, keep the original row ID and text available. Do not substitute a measured zero just to avoid an empty field.

Use controls after changing a rule

Test the next export with a single-digit count, a multi-digit count, a multiword rider, a longer order ID, a missing marker and a known valid midnight. These fixtures check different failure modes. If you decide to add another supported source pattern, confirm the current one continues to give its original results.

Build a complete rider extraction without newer text functions

When a review copy must open in more than one Excel edition, prepare a tested formula path that its recipients can use. A worksheet can locate the same rider markers with FIND and use MID to read the stretches between them. Keep the clock validation from the second lab. In your own Rider Notes copy, add two temporary numeric helper columns in J and K.

Find the two positions in order

Use =IFERROR(FIND(" delivered ",B2),0) in J2. In K2 use =IF(J2>0,IFERROR(FIND(" at ",B2,J2+LEN(" delivered ")),0),0). K starts its search after the first required marker. Both helpers use zero when unavailable. A note with a pickup phrase instead of the required delivery phrase has no confirmed delivery marker, even if it includes a time elsewhere.

Replace only the extraction formulas

Use the next expressions as C2:E2 in your scratch copy, then fill down. The first checks the required Rider prefix and enough room for the name. The second needs space for the order ID between the delivery marker and the final marker. The third takes the remaining text after the clock marker. Existing F:I checks still decide whether there is a complete usable record.

C2 =IF(AND(EXACT(LEFT(B2,6),"Rider "),J2>7),MID(B2,7,J2-7),"")
D2 =IF(AND(J2>0,K2>J2+LEN(" delivered ")),MID(B2,J2+LEN(" delivered "),K2-J2-LEN(" delivered ")),"")
E2 =IF(K2>0,MID(B2,K2+LEN(" at "),LEN(B2)),"")

Compare RN-01 and RN-02 first. The second rider has two words, which stay together because the end is a complete marker rather than the next space. RN-03 carries a longer ID and a valid midnight. These records give the same final ready results with either formula route. RN-06 has no delivery marker and remains Review boundaries. With the fallback path its clock text helper also stays empty, because K was not eligible to search.

Use the same sample notes when testing a second edition. If your local configuration uses another list separator, use it consistently. Keep the exact source range, version tested, expected status and output fields in your handover. A reviewer should know which formula path produced the result and which behaviour was checked.

Keep empty fields in a delimiter-based export

Some systems can provide a well-defined line with fields separated by a pipe character. A training export might use the order ID, city, number of minutes and unit in that order. A file such as this can be simpler to parse than a free-text note because every row has an explicit field structure. Verify the meaning and expected number of separators before assuming its parts line up.

Preserve the position of a missing value

In an Excel edition that supports TEXTSPLIT, with the raw string in A2 and clear cells to the right, try =TEXTSPLIT(A2,"|",,FALSE). The second argument is the column delimiter. The row delimiter is omitted. FALSE keeps an empty field between adjacent separators. TEXTSPLIT has no instance selection argument in this signature. The result is a sequence of fields across the row.

Four fields under the practice export's rule
Raw stringIDCityMinutesUnit
BLK-260314-001|Pune|9|minsBLK-260314-001Pune9mins
AMN-260314-006||10|minsAMN-260314-006Empty field10mins
BLK-260314-0112|Nashik|125|minsBLK-260314-0112Nashik125mins

If you ignore the empty field in the second row, 10 can appear in the position that should contain the city. The unit may also move left. A report might look like it has fewer missing values while its columns are corrupted. Verify the positions before converting 10 to a numeric measure. Preserve the empty City position and keep its own review status.

Check a new delimiter in the field itself

If the source can contain literal pipes inside a description, ask how it quotes or escapes those characters. A formula that splits at every pipe will divide the description too unless a suitable parser understands the format. The simple example uses no escaped delimiters. For a real structured file, use its supported importer or Power Query rule and verify a deliberately quoted case.

Define a stricter optional pattern for the experiment

In supported builds, REGEXEXTRACT can capture several fields matching a documented text pattern. It is useful when the full string must have a predictable shape. Keep the earlier formula steps for learners who need a compatible path. Use a pattern when you can explain what it accepts and maintain a small test set showing why the other inputs do not pass.

Read each group in the pattern

For the Delivery Notes examples, an optional test in an empty area starting on the same row is =REGEXEXTRACT(A2,"^Order ([A-Z]{3}-[0-9]{6}-[0-9]+) delivered in ([0-9]+) mins$",2). The start and end anchors scope the match to a line in the simple fixture. The first parentheses capture an uppercase three-letter prefix, a six-digit middle group and a numeric suffix. The second parentheses capture the numeric minutes. Return mode 2 returns capture groups from the first match, so provide an empty area for the array output.

Check the normal example and the longer suffix. The ID group still contains its hyphens and zeroes. The minute group comes back as text and needs a numeric conversion only after the measurement is confirmed. The wrong-unit and pending cases do not match the documented pattern. Keep a missing-match status instead of treating the optional expression as the whole review process.

Compare a shape match with a source record match

The pattern uses any three uppercase letters, so it can pass an unrecognised prefix of the right shape. It does not verify that the order exists, that the middle group is a date or that the amount belongs to a delivery. If the input requires a confirmed list of platforms, check the ID's prefix separately against that list. Keep a matched-order review field when the parsed identifier will drive a real lookup.

Does a stricter regular expression make the ID a verified order record?

It can verify the shape of the extracted characters. Match the ID against the correct source system if you also need evidence of the order's existence or identity.

Review notes that contain more than one possible ending

A free-text note may mention a clock more than once. Consider the fictional note “Rider Raja delivered BLK-260314-007 at 19:51 at depot.” TEXTAFTER using the first " at " can return 19:51 at depot. This is longer than the five-character clock field in the lab, so the reviewed time stays unavailable. Using the final instance instead would return depot rather than the time. Neither substring gives a complete verified clock value under the original contract.

Test a rule for multiple occurrences before accepting it

Modern TEXTAFTER supports an optional instance argument. A negative instance searches from the end. This can be useful when a source promises that the final section always holds the target. Document that promise and test different note examples. On messages with appended comments, the last mention may describe a later unrelated event. Prefer a separate structured time field when you can request one.

Build a scratch set with a note that ends exactly at the clock, one with an appended depot comment and a third with a missing delivered marker. Each should have a clear expected outcome. A rule that accepts the first and holds the other two is appropriate for our strict format. If a source owner approves extra comment fields, parse the separate boundary deliberately and run the existing tests again.

Preserve every original event for follow-up

The order ID identifies a transaction in the source, but an export can contain multiple notes for that transaction. Check the distinction between records and order IDs when calculating a metric. Each source note can retain an original row ID. Decide which event, such as the first confirmed delivery, the business wants before deduplicating or calculating time from several records.

Distinguish an unusual measured duration from parser failure

The 125-minute case has a valid note shape and an ordinary integer duration. It is much longer than 9, 10 and 18. That makes it a useful observation to review under a separate business anomaly check. It does not by itself show a broken extraction. Look at the raw minutes and source notes before excluding an unusual result or altering the parser.

Read the data policy and the expected totals together

Suppose a new note reads 12.5 mins under the same format. Depending on the configured decimal separator and source convention, VALUE can interpret 12.5 as a number. The first lab requires whole minutes, so the final review status should flag that row when numeric parsing yields a fraction. It should not silently round it. If a verified new file records tenths of a minute, update the explicit numeric rule and test that it accepts the intended precision.

Try this optional scenario on a copy of the first lab by replacing the 125-minute fixture with a confirmed 12.5-minute measurement in the correct local decimal syntax. Under the original integer policy the numeric report still uses 9, 10 and 18, for a total of 37 over three ready records. Under a separately approved fraction policy, 12.5 also qualifies, giving 49.5 over four. The source record count stays seven. Restore the initial fixture after checking both policies.

When presenting a value, give the unit, policy and eligible record count. A verified extreme measurement, an unsupported fractional unit, and a missing input call for different next actions even if they all appear on the same dashboard's review list.

Review the difference between a proposed fill and a repeatable rule

Excel's Flash Fill can suggest data based on examples you enter beside the source. It can be helpful when inspecting a short list. A suggested output gives you values to review. It has no written explanation of how it chose every character in each row, so you still need the raw note and boundary cases. A formula with named markers leaves its rule available for someone else to inspect.

Try two representative examples in a scratch sheet

In a supported desktop build, place the ordinary Delivery Notes examples in a temporary column. Type the first expected ID beside the first note and type an ID from a different-width note beside its source. Try the available Flash Fill action in the output. If the app infers a pattern, inspect those values and specifically check the longer BLK-260314-0112 value. Check the delayed-in example before accepting any suggested outputs for it.

Flash Fill may infer a plausible ID from a note whose event type does not match the report. That does not mean the note is eligible for the duration measure. Add or review a separate event-type and unit condition before using any result. If a source note changes later, verify the filled output again. A value produced in a fill operation is different from an output calculated by a current worksheet formula.

Choose a method that supports recurring imports

For a monthly report, test the same input data under the method the next person will use. A controlled formula, structured export or documented query can provide a reproducible process. Record the extraction markers and input range. Include unusual notes in the test set. Use approved version-specific options and give a simple fallback path such as the FIND and MID helper method shown earlier.

If the source team can provide structured columns for Order ID, Duration and Unit, request those fields for the repeated data flow. Then the workbook can validate the values directly. You can still keep the note for context. This reduces disagreement about which phrase in prose was supposed to supply the measured value.

Reconcile the full record count after conversion

Deliver the report with its source count and its available measures. In Delivery Notes, the expected seven records split into four ready and three needing review. Now append a new source event row with a declared ID and no note content in a scratch copy. Fill the helper formulas through that row. Its status is Missing, and the original four valid numeric results remain unchanged.

Compare an empty-note case with a measured zero

For a separate controlled test, replace the first record's 9 mins with 0 mins under a scenario where zero is a verified numeric observation. Status remains Ready. The usable count stays four and the sum falls from 162 to 153. This outcome is different from leaving the entire note blank. The blank row has no confirmed measure. Some operational processes might reject a zero duration, so use the actual rule for the metric rather than rounding or replacing it automatically.

For a report, create a final numeric helper that returns F only when the status in G is Ready. Use COUNT on that final helper to check measured rows, including the genuine zero where allowed. Keep the raw record count separately, using a source record identifier that is populated even for the empty-note case. A count taken from the raw note column alone could miss that record.

Explain one example in the handover

A report can say “seven source notes, four ready durations and three unresolved. The temporary blank control gives eight source records and one Missing status while preserving the four ready results.” List the reason categories instead of replacing each case with an empty cell whose cause is unknown. The analyst can then check whether the next import introduced more missing notes, a new unit or a different event marker. Restore the optional controls after comparing the scenarios.

Why can the raw row count rise without the numeric count rising?

A record can exist without a measured value. Count source identifiers to measure incoming records and the checked numeric output to measure usable durations. Keep an explicit missing or review category to reconcile the difference.

Test three changes without changing the raw worksheet

  1. Try a longer ID. Compare the fixed 14-character slice and marker extraction on BLK-260314-0112. Check. The first can lose part of the suffix and the second preserves it.
  2. Try a different unit. Keep a verified order ID and enter a note ending in hrs. Check. The duration stays unresolved under the minutes-only rule.
  3. Compare a clock boundary. Contrast 23:59 and 24:00 in a controlled note. Check. The first qualifies for this ordinary 00-through-23 worksheet rule. The second needs interpretation or review under the source's actual convention.

Check your understanding

1. What should a prefix-based MID extraction check first?
  • A. That the source reliably uses the promised positions
  • B. That the current column width is large
  • C. That the ID can be added numerically

Answer A. The method depends on fixed positions. A changed leading phrase or ID length can cause a wrong but plausible substring.

2. Which result should stay as text?
  • A. A measured minute count that a report averages
  • B. Order ID BLK-260314-001
  • C. Every value that appeared in a note

Answer B. It identifies a record and its characters matter. The separate verified duration can become a numeric measurement.

3. A note uses hrs while the workbook expects mins. Which action is right?
  • A. Use the same numeric value as minutes
  • B. Delete the source note
  • C. Review the unit and use only a documented conversion

Answer C. The number's meaning depends on the unit. A workbook should hold the case or apply a confirmed conversion rather than relabelling it.

4. Why does the rider lab test the hour before calling TIME?
  • A. TIME can normalise an out-of-range value such as 25 hours
  • B. TIME refuses to calculate any ordinary afternoon values
  • C. A valid time must always be text

Answer A. The underlying function can produce a different clock from the source. The lab rejects unsupported clock parts before construction.

5. What is the time value for a verified midnight under the exercise rule?
  • A. A formula error
  • B. Numeric zero with a time display
  • C. A blank that means missing

Answer B. Midnight is the beginning of the day in this expression. A numeric check keeps it distinct from an unmeasured value.

6. How can you check a marker extraction's result after a source update?
  • A. Scan only the first well-formed note
  • B. Remove all review status labels
  • C. Compare ordinary and exception controls and reconcile the counts

Answer C. A single normal note does not test all boundary conditions. Include a longer field and a failure example for each important rule.

Interview questions with worked answers

When do you use a fixed position to extract an ID?

I use fixed positions when the verified source contract guarantees them. If the ID can have variable length and a reliable marker follows it, I use that marker and check known short, long and missing cases. I keep the extracted ID as text.

How do you convert minutes from a message into a reportable measure?

I find the intended opening and closing markers, extract the field, verify its unit and then convert the numeric text. I keep the raw note and report a review status when its content is missing or unexpected.

Why can Flash Fill need review when splitting a data feed?

It infers a pattern from examples and can be useful in an exploratory copy. I test its results on unusual rows. A documented formula or query rule can be more reproducible for a recurring import, with failures recorded separately.

How do you convert text reading 08:05 into a useful clock value?

I validate the expected format and both parts, then build a numeric time with TIME under the source's clock convention. Applying a number format to unconverted text does not make it a time. I check midnight separately from missing values.

How would you prove a cleanup did not omit records?

I keep a source row ID and reconcile source count, ready count and review count. I include one exact trace to the source and one deliberately unsupported note. Every input row should have a visible outcome.

Quick recall cards

  • Fixed slice

    Use a known start and width only when the source contract guarantees them.

  • Boundary markers

    Find the complete markers around the target field and compute the length between them.

  • Identifier

    Preserve text, delimiters and meaningful zeroes. The code identifies a record.

  • Measured value

    Verify units and type before converting text for arithmetic.

  • Clock

    Check the original hour and minute range before constructing a numeric time.

  • Exceptions

    Keep malformed or unfamiliar records and their review statuses beside the source.

The next lesson checks unwanted characters. Keep your known markers, exact source strings and review controls available so any cleanup can be checked against the intended field extraction.

Official Microsoft references

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