Converter tool

Date Difference for CSV

Add a column with the days, business days, whole months or whole years between two dates in every row, or from each date to today. Free, and it runs in your browser.

Accepted: 2026-11-12, 12/11/2026, 12 Nov 2026 and Nov 12, 2026. Times after an ISO date are ignored. Two-digit years and impossible dates such as 30 February are reported, not guessed. Business days skip weekends only, not public holidays. The file is read by this browser tab.

Preview

Output Preview

Load a CSV, choose the start and end dates, and press Calculate.

Date Difference for CSV

Operator: Abdulla Al Fahad. How tools are built and checked

Date Difference for CSV adds one column to a CSV: the gap between a start date and an end date on every row. The gap can be counted in calendar days, in business days (Monday to Friday), in whole months or in whole years. The end can be another column in the file, such as a delivery date, or today's date, which turns a column of birth dates into ages or a column of invoice dates into days outstanding.

The part that usually goes wrong in a spreadsheet is reading the dates, not subtracting them. 03/11/2026 is 3 November in most of the world and 11 March in the United States, and a spreadsheet that guesses will silently mix the two in one column. This tool makes you state the order once, checks every date against the real calendar, and lists each cell it could not read instead of filling in a number for it.

Key features

  • Four units: days, business days, whole months, whole years
  • End date from a second column or from today's date on your device
  • Day-first or month-first reading of numeric dates, set once for the file
  • A warning with a count when cells such as 03/11/2026 would be valid either way round
  • Real calendar checks, including leap years: 29 February 2024 is accepted, 29 February 2026 is not
  • A per-cell report of unreadable dates, with the reason
  • Negative results when the end date is before the start date, with a count of such rows

Accepted date forms: ISO dates (2026-11-12), optionally followed by a time such as 2026-11-12T08:30:00Z, where the time and any offset are ignored and only the written date is used; numeric dates with a four-digit year separated by slashes, dots or hyphens (12/11/2026, 12.11.2026, 12-11-2026), read day-first or month-first according to the setting; and dates with an English month name, either day first (12 Nov 2026, 12-Nov-2026, 12th November 2026) or month first (Nov 12, 2026).

Rejected on purpose: two-digit years (12/11/26), because choosing 1926 or 2026 would be a guess; days that do not exist in that month, such as 31 April or 29 February 2026; years outside 1000 to 9999; and anything else, such as Excel serial numbers (46338) or text like "next Tuesday". Each rejected cell is listed with its data row, its column and the reason.

The output is the original CSV with every column unchanged, plus a new last column named days_between, business_days_between, months_between or years_between. If your file already has a column with that name, the new one gets a suffix such as days_between_2. Rows where either date could not be read keep their data and have an empty cell in the new column. Input must be comma-separated; files up to 25 MB are accepted.

How it works

Each date is converted to a day number, the count of days since 1 January 1970 in the Gregorian calendar, using integer arithmetic only. Because no clock time or time zone is involved, a difference across the end of daylight saving time is still a whole number of days, which is a common source of off-by-one results when dates are subtracted as timestamps.

Days is end minus start. Business days counts each Monday to Friday from the start date up to, but not including, the end date, using whole weeks plus the remaining days rather than a day-by-day loop. Whole months follows the same rule as the DATEDIF function with "m": count the month boundaries crossed, then take one away if the end day of the month is smaller than the start day. Whole years is whole months divided by 12, rounded down.

When the end is Today, the date is read once from your device's clock in its local time zone at the moment you press Calculate, and the result line states which date was used. The file is read and the new CSV is built by this browser tab; the download is created from memory.

Common use cases

  • A warehouse manager measures delivery lead time for every order in a month's export, in business days, to compare carriers on the same basis their contracts use.
  • An HR assistant turns a staff list with start dates into a column of whole years of service, to see who reaches a five- or ten-year milestone this year.
  • A credit controller sets the end date to Today against a column of invoice dates and sorts by days_between to see which invoices are past 30, 60 and 90 days.
  • A clinic administrator checks a list of patient dates of birth against Today in whole years, and uses the unreadable-cell report to find records where the date was typed with a two-digit year.

How to use this tool

  1. Choose a CSV or press Use sample data to load six example orders.
  2. Pick the start date column. The tool pre-selects the first column that looks like dates.
  3. Pick the end date column, or choose Today.
  4. Choose the unit: days, business days, whole months or whole years.
  5. Set whether numeric dates are day first or month first. If an amber warning appears, check this setting against a date you know.
  6. Press Calculate, review the preview and the list of unreadable cells, then download the CSV.

Example

orders.csv, numeric dates written day first

order_id,ordered,delivered
A-1001,2026-11-02,2026-11-09
A-1002,03/11/2026,10/11/2026
A-1005,2026-02-27,2026-03-02
A-1006,2026-02-29,2026-03-04

Days, then business days (run twice)

order_id,ordered,delivered,days_between
A-1001,2026-11-02,2026-11-09,7
A-1002,03/11/2026,10/11/2026,7
A-1005,2026-02-27,2026-03-02,3
A-1006,2026-02-29,2026-03-04,

business_days_between for the same rows: 5, 5, 1, (empty)

Reported: data row 4, ordered "2026-02-29": February 2026 has 28 days,
so day 29 does not exist

Tips for best results

  • Look at one row you can verify by hand before trusting the column. If an order placed on 3 November shows 120 days instead of 7, the order setting is the wrong way round.
  • Calculate days and business days in two passes if you need both. Each run adds one column, and the second run starts from the first run's download.
  • For ages, use whole years with Today as the end. A person born on 15 June 1990 is 36 on 12 November 2026, and the result stays 36 until their birthday in June 2027.
  • If your export has date and time in one cell in a non-ISO form, such as 12/11/2026 14:05, split off the time first. Only ISO dates may carry a time.

Common pitfalls

Business days ignore public holidays. A week containing a national holiday still counts five working days. If holidays matter, subtract them afterwards from a holiday list for your country, or treat the figure as an upper bound.

The end date is excluded from business days but the start date is included. An order placed on Friday and delivered on Monday counts as 1, the Friday. If your service level counts the delivery day instead, add one wherever the delivery date falls on a weekday.

Whole months are counted the strict way. 31 January to 28 February 2026 is 0 whole months, because 28 is smaller than 31; it becomes 1 on 1 March, when the month boundary into March is crossed. In the same way someone born on 29 February 2024 has 0 whole years on 28 February 2025 and turns 1 on 1 March 2025. This matches DATEDIF, but some contracts count end-of-month to end-of-month as one month.

Today comes from the device. A computer with the wrong date, or a run just after midnight in a different time zone from your colleagues, gives a different Today, and the result line shows which date was used.

The day-first or month-first choice applies to the whole file. A column that mixes 25/12/2026 and 12/25/2026 cannot be read correctly in one pass; the cells that do not fit the chosen order are reported, with a hint that the other order may apply.

Common errors and how to fix them

"there is no month 25; the column may be day-first"
The order setting is month-first but the file was written day-first, so 25/12/2026 was read as month 25. Switch the setting and press Calculate again.
"two-digit years are not read, because the century would be a guess"
Fix the source so years have four digits. In most spreadsheets, a custom cell format of dd/mm/yyyy before exporting to CSV writes the full year.
"not a recognised date format" on every row
The column probably holds spreadsheet serial numbers such as 46338, or dates with a non-English month name. Format the column as a date in the spreadsheet before saving the CSV, or use the ISO form.
"The start and end columns are the same column."
Pick a different end column, or choose Today if you meant to measure up to the current date.

Best practices

  • Export dates in ISO form (YYYY-MM-DD) when your system allows it. It sorts correctly as text and is never ambiguous.
  • Keep the reported-cell list. Each one is a record with a wrong or missing date in the source system, which is usually worth fixing there.
  • State the unit and the inclusion rule when you share the numbers. Lead time of 5 means different things in calendar days and in business days that exclude the end date.
  • For figures measured to Today, note the run date in the file name, because the same file run tomorrow gives different numbers.

Signed results and reversed columns

The difference is end minus start, so an end date earlier than the start gives a negative number: 19 November to 12 November is -7 days and -5 business days. The tool keeps the sign instead of hiding it because a negative lead time almost always means swapped columns or a data entry error, and the result line counts those rows so you notice them.

Negative months and years are counted the same way in reverse, so 12 November 2026 back to 15 June 1990 is -36 whole years. If you picked the columns the wrong way round, swap them and run again rather than editing the signs by hand.

Calendar dates, not timestamps or working calendars

The tool works on calendar dates only. It does not measure hours or minutes between two timestamps, does not convert time zones, and does not know about holidays or custom working weeks such as Sunday to Thursday.

  • One difference column per run
  • English month names only
  • Comma-separated files up to 25 MB

Frequently asked questions

How are business days counted between two dates?

Every Monday to Friday from the start date up to the day before the end date is counted. From Thursday 12 November 2026 to Thursday 19 November 2026 that is Thursday, Friday, Monday, Tuesday and Wednesday: 5. A start and end on the same day gives 0.

Why is 31 January to 28 February not one month?

A whole month is only complete when the end date reaches the same day number as the start, and February has no 31st. The tool follows the DATEDIF rule rather than treating the last day of each month as equivalent. If you need end-of-month matching, use the days unit and divide, or adjust those rows by hand.

Does it handle leap years?

Yes. Each date is checked against the length of its month in its year, using the Gregorian rule that years divisible by 4 are leap years except century years not divisible by 400. 29 February 2024 is accepted and 29 February 2026 is reported as invalid. Days between dates that span 29 February 2024 include that day.

Which date does Today use?

The date on the device's clock, in its local time zone, read when you press Calculate. It is shown in the result line, for example "measured to 2026-11-12", so the downloaded figures can be traced to a date.