Back to cookbook

AI Prompt to Standardize Inconsistent Date Formats Across a Dataset

0 views Updated

Make this prompt yours

Share

This AI prompt for standardizing date formats helps analysts, ops teams, and anyone who inherits spreadsheets from multiple sources turn a column full of mismatched dates into one clean, consistent format. Dates like 03/04/2024, April 3 2024, 2024-04-03, and 3-Apr-24 sitting side by side in the same column break sorting, filtering, and any downstream formula or chart, and manually retyping hundreds of rows is slow and error-prone.

The prompt below asks ChatGPT, Claude, or Gemini to detect the format of each date value, flag ambiguous cases (like 03/04/2024, which could be March 4 or April 3 depending on locale), and convert everything to a single target format you specify, such as ISO YYYY-MM-DD. It also asks the model to call out any values it can't confidently parse rather than guessing silently, which matters because a wrong guess on an ambiguous date is worse than no guess at all.

Because the model is working from text you paste in rather than live data, always spot-check a sample of the converted output against the originals before trusting the full set, especially for two-digit years or day/month-ambiguous formats. Once you've got a clean, filled-in version of this prompt, running it back through Prompt Debugger is a quick way to catch any edge cases in your instructions, like what to do with blank cells or partial dates, before you rely on it for a larger dataset.

Prompt template

Make this prompt yours

prompt-template
239 tokens
ROLE: You are a meticulous data cleaning assistant specializing in date normalization. CONTEXT: I have a dataset with a column of dates in inconsistent formats. The source systems use these locale conventions: [LIST SOURCE FORMATS, e.g., US month/day/year from System A, European day/month/year from System B]. Here is the raw data: [PASTE DATE VALUES OR ROWS HERE] TASK: 1. Identify the format of each date value. 2. Convert every date to this exact target format: [TARGET FORMAT, e.g., YYYY-MM-DD]. 3. For any date you cannot confidently parse (ambiguous day/month, missing year, invalid date, etc.), do NOT guess — list it separately under "Needs manual review" with a note on why it's ambiguous. CONSTRAINTS: - Do not alter values that are already in the target format. - Treat two-digit years as [YOUR RULE, e.g., 20XX unless clearly 19XX]. - Preserve the original row order. OUTPUT FORMAT: Return a table with three columns: Original Value | Converted Value | Status (Converted / Needs manual review). After the table, list the total count of each status.

Want it sharper? Optimize this prompt with Prompt Optimizer, check it with the Prompt Debugger or shorten it with the Token Optimizer.

Example input

example-input
249 tokens
ROLE: You are a meticulous data cleaning assistant specializing in date normalization. CONTEXT: I have a dataset with a column of dates in inconsistent formats. The source systems use these locale conventions: US month/day/year from our CRM export, and free-text dates typed manually by sales reps. Here is the raw data: 04/02/2024 March 15, 2024 2024-01-30 5-Dec-23 12/31/23 02/30/2024 TASK: 1. Identify the format of each date value. 2. Convert every date to this exact target format: YYYY-MM-DD. 3. For any date you cannot confidently parse (ambiguous day/month, missing year, invalid date, etc.), do NOT guess — list it separately under "Needs manual review" with a note on why it's ambiguous. CONSTRAINTS: - Do not alter values that are already in the target format. - Treat two-digit years as 20XX unless clearly 19XX. - Preserve the original row order. OUTPUT FORMAT: Return a table with three columns: Original Value | Converted Value | Status (Converted / Needs manual review). After the table, list the total count of each status.

When to use it

  • You're merging spreadsheets or exports from different tools (CRM, billing system, forms) that each log dates differently
  • A date column has a mix of formats after being copy-pasted from multiple sources over time
  • You need every date in one consistent format before importing into a database, BI tool, or another spreadsheet
  • You're preparing data for a pivot table, chart, or time-series analysis and inconsistent formats are breaking the sort order

Best practices

  • Always state your target format explicitly (e.g., YYYY-MM-DD) rather than saying "a consistent format" and leaving the model to choose
  • Call out your locale convention (day/month/year vs month/day/year) up front so the model doesn't guess wrong on ambiguous dates like 03/04/2024
  • Ask the model to output a separate "flagged" list for any value it couldn't confidently parse, instead of silently forcing a best guess
  • Work in batches of a few hundred rows at a time rather than pasting an entire multi-thousand-row dataset, so you can actually verify the output

Common mistakes

  • Not specifying a target format, which leads the model to pick one that may not match what your downstream tool expects
  • Ignoring two-digit years (24 vs 2024), which creates silent errors decades apart if the century is ambiguous
  • Assuming the model's conversion is 100% correct without spot-checking a sample, especially for day/month-ambiguous dates
  • Pasting a huge dataset in one shot instead of smaller batches, making errors much harder to catch

FAQs

How do I get ChatGPT to stop guessing on ambiguous dates like 03/04/2024?

Tell it explicitly to flag anything ambiguous instead of guessing, and state your locale convention (month/day/year or day/month/year) up front. Without that instruction, most models will silently pick one interpretation and move on, which is how errors slip through.

Can AI reliably convert dates in a huge spreadsheet in one pass?

It can handle a few hundred rows reasonably well if you ask it to flag uncertain values, but accuracy drops as volume grows and errors get harder to spot in a huge table. Working in smaller batches and spot-checking a sample is safer than trusting one massive conversion.

What's the safest date format to standardize to?

ISO 8601 (YYYY-MM-DD) is the safest choice because it sorts correctly as plain text, has no month/day ambiguity, and is understood by virtually every database, spreadsheet tool, and programming language.

Which Cuelara tool can help me turn this into a reusable prompt for other data-cleaning tasks?

Prompt Builder — describe any other messy-data cleanup task in plain language and it turns that description into a full structured prompt you can reuse, the same way this one is structured.

Found this prompt useful? Share it.

Share

More in Data Analysis

Data Analysis

AI Prompt to Merge and Reconcile Two Datasets With Mismatched Columns

This AI prompt is for anyone who needs to merge two datasets that don't line up cleanly — different column names, inconsistent formatting, o…

You are a data integration specialist merging two datasets that use inconsistent structures.

Context:
- Dataset A description: [WHAT DATASET A CONTAINS AND ITS SOURCE]
- Dataset A columns: [LIST COLUMN NAMES]
- Dataset B description: [WHAT DATASET B CONTAINS AND ITS SOURCE]
- Dataset B columns: [LIST COLUMN NAMES]
- Field(s) that should uniquely identify a matching record: [E.G. EMAIL, CUSTOMER ID, OR NAME + DATE OF BIRTH]
- Dataset A sample: [PASTE DATA HERE]
- Dataset B sample: [PASTE DATA HERE]

Task:
1. Propose a column mapping between dataset A and dataset B, noting any column in either dataset with no clear equivalent in the other.
2. Normalize formatting differences (dates, currency, capitalization, abbreviations) so matching fields can be compared fairly.
3. Match records between the two datasets using the specified key, and merge matched records into a single row per entity.
4. List any records that could not be confidently matched, along with the reason (missing key, near-duplicate, conflicting data).
5. Flag any records where the same key appears to have conflicting values across the two datasets.

Constraints:
- Do not force a match when the key fields don't align; list it as unmatched instead
- Preserve all original column data in the merged output rather than dropping fields that don't map directly
- [ADD ANY DOMAIN-SPECIFIC RULES, E.G. "TREAT 'INC' AND 'INCORPORATED' AS THE SAME COMPANY SUFFIX"]

Output format:
- A proposed column mapping table (Dataset A column, Dataset B column, Notes)
- A merged table of matched records
- A separate list of unmatched or conflicting records with the reason for each

Make this prompt yours

Data Analysis

AI Prompt to Audit a Notion Database for Data Quality Issues via Notion's MCP Server

This Notion MCP prompt is for operations, data, and RevOps teams who keep a working database in Notion (a CRM tracker, inventory log, projec…

You are a data quality analyst reviewing a live database retrieved via an MCP connection to Notion.

Context:
- Database name: [DATABASE_NAME]
- Approximate number of records: [RECORD_COUNT]
- Required properties that must always be filled in: [REQUIRED_PROPERTIES]
- Properties with a fixed set of intended values (e.g. Status should only be one of a known list): [CONTROLLED_PROPERTIES_AND_VALUES]

Task:
Retrieve the records in this database and check them for the following issues:
1. Missing values in required properties
2. Duplicate records (same entity represented more than once)
3. Inconsistent formatting or casing in controlled properties
4. Broken or empty relation fields
5. Date fields that are empty, in the past when they shouldn't be, or otherwise clearly incorrect

Constraints:
- Only flag issues you can verify from the retrieved data; do not guess at values you cannot see
- Group findings by issue type, then by severity (Blocking, Needs Review, Cosmetic)
- Include the page title or unique identifier for every flagged record so it can be located in Notion

Output format:
Return a structured report with one section per issue type. Each section should list affected records as a short table: [Record Name | Issue Description | Suggested Fix]. End with a one-paragraph summary of total issues found and the top priority to address first.

Make this prompt yours

Data Analysis

AI Prompt to Audit Google Sheets Formulas for Errors Using Google Workspace's MCP Server

This prompt turns an AI assistant into a spreadsheet auditor that can read a live Google Sheet through Google Workspace's MCP server and sys…

ROLE
You are a meticulous spreadsheet auditor with deep expertise in Google Sheets formulas, functions, and data integrity, connected to the live sheet via an MCP server.

CONTEXT
Spreadsheet name: [SPREADSHEET NAME]
Tab/sheet to audit: [TAB NAME]
Purpose of this sheet: [WHAT THE SHEET IS USED FOR, e.g. "monthly revenue forecast shared with the finance team"]
Known manual-override columns (do not flag as errors): [LIST OF COLUMNS OR "NONE"]
Date or version this sheet was last fully reviewed: [DATE OR "NEVER"]

TASK
Using the MCP connection, read every formula in the specified tab and identify:
1. Broken references (#REF!, #VALUE!, #N/A, #DIV/0! and similar error values)
2. Formulas that reference a range which no longer matches the data (e.g. a SUM or VLOOKUP range that stops short of new rows)
3. Inconsistent logic within a column, where some rows use a formula and others contain a different formula or a hardcoded value with no explanation
4. Circular references or formulas that indirectly depend on their own output

CONSTRAINTS
- Do not flag the manual-override columns listed above as errors
- Quote the exact formula text and cell address for every issue found
- Do not rewrite or change any formulas in the sheet; only report findings
- If a formula's intent is ambiguous, say so explicitly rather than guessing what it was supposed to do

OUTPUT FORMAT
Return a table with these columns: Cell Address | Formula Found | Issue Type | Explanation | Suggested Fix (if obvious)
Follow the table with a short summary: total issues found, how many are broken references vs. logic inconsistencies, and which columns need the most attention.

Make this prompt yours