Why can COUNTIF match unintended codes?

A person compares blank tags in a hardware shop beside hinges and round drawer knobs.

Key points

  1. Define the complete text being sought.
  2. Keep source data and criteria separate.
  3. Label results that have not been verified.

Why can other text be matched?

Because asterisks and question marks are COUNTIF wildcards. State the intended requirement before investigating an unexpected total.

Imagine a small shop whose product identifiers include punctuation and a colleague who wants to review one complete code. This is a fictional requirement, not actual stock or order data. Have the data owner confirm included and excluded examples before deciding how to express the request.

What example can you start with?

Fictional illustration: =COUNTIF(A2:A5,"AB~*") seeks literal AB* in A2:A5. This follows the documented rule and has not been run in your workbook.

Ask a colleague to confirm that this describes the business requirement rather than adopting it simply because it is short. Establish what the range represents, why these items are being counted and whether the data has been verified by its owner. A formula fragment does not define an enquiry, a product or an order for the business.

Hands hold blank kraft tags beside drawer pulls, screws and a notebook.

Which three things should an investigation separate?

This proposed requirements table is not an instruction to rename or clean data.

LevelSuggested recordConfusion to avoid
Source textOriginal code and its provenanceChanging the source first to make a result look reasonable
Business requirementCases that should be included and excludedSubstituting similar appearance for a complete definition
Actual methodFormula, applicable range and observed resultCalling an unexecuted illustration a test

If colleagues interpret the same example differently, settle the definition before rewriting the whole sheet. Retain necessary context without adding unrelated customer information to the investigation.

How can the check avoid being driven by a desired total?

List expected inclusions and exclusions in authorised sample data before an authorised person runs a comparison. Record differences from the expectation rather than repeatedly adjusting criteria until the total resembles a colleague’s recollection.

Return unexplained source material to the data owner. A match that meets the stated requirement cannot by itself verify business identity, provenance or the reporting period. This article does not instruct you to delete duplicate records or rewrite production product codes.

Which limits should remain in the handover?

Keep the confirmed matching requirement, applicable range, verification state and unresolved questions. Distinguish understanding the method, testing a copy and approving a production result. None of these stages alone establishes that all work is complete.

For organising enquiry and internal data handover requirements, see HKONE’s AI customer-service offering. Excel formulas, data checks and integration require separate scope confirmation. No production workbook has been read, changed or calculated here.

Frequently asked questions

Do quotes disable COUNTIF wildcards?

No.

Where should ~ go in COUNTIF?

Before * or ? in the criterion.

Do ? and * match the same scope?

No; ? matches one character; * matches any sequence.

Does ~ make COUNTIF case-sensitive?

No.

Does an expected result authorise deleting data?

No. Checking a count and deleting records are separate decisions requiring a business basis and appropriate approval.

About the author: This article was written by the HKONE team. HKONE is a Hong Kong digital marketing and AI automation company providing social media management, website design, AI customer service and GEO / SEO for SMEs. Where this article mentions platform fees or policies, the platform's official information takes precedence.

Tell us about your business first. Then decide.

The consultation is free. We will understand your situation before recommending a plan and a quote.