Library › Coding AI › Small business owners

Pull order numbers out of customer messages

Practice: Showing an example of what you want. About 5 minutes.

About this exercise

Write one Google Sheets formula for B2 (filled down) that finds the order number in the customer message in A2. Customers type it as ck-10422, CK 10422, #CK10422 and so on; order numbers are CK plus exactly 5 digits. Always return it in one format, like CK-10422 (capitals, hyphen). If there's no order number, show NO ORDER #. One formula in one code block, then under 25 words outside the code.

Common mistakes when you ask AI for this

  • Not showing the messy versions. The AI matches only one spelling, like CK-10422, and misses the rest. Try: Add examples: "ck-10422, CK 10422, #CK10422 are all the same."
  • Not showing the output format. The AI returns whatever the customer typed, which your shop can't look up. Try: Add: "Always return it like CK-10422."
  • Leaving no-match open. Messages without a number show #N/A. Try: Add: "If there's none, show NO ORDER #."
  • Getting a menu of options. The AI likes to offer two or three versions of the formula, so you're left to pick and test them yourself. Try: Add: "Give one formula only, in one code block, no alternatives."
  • Getting a tutorial. By default the AI explains every part of the code at length, which you then have to scroll past. Try: Add: "After the code, one line under 10 words. Nothing else."

What a strong prompt includes

  • Shows the messy versions
  • Shows the output format
  • Handles no match
  • Asks for one answer only
  • Limits the explanation

Practice this now ↑

Related exercises