Home Calculators Blog About Contact
Home Calculators Add or Subtract Days From a Date
Date & Time

Add or Subtract Days From a Date

Enter a start date, choose how many days, and pick a direction. Handles leap years, month boundaries, and business-day calculations automatically.

Reviewed & Maintained by
Aadil MalikSoftware Engineer
10 min read  ·  1,977 words
Add or subtract days from date calculator with start date, day count, and direction toggle

What Does Adding or Subtracting Days From a Date Mean?

Adding days moves a date forward on the calendar; subtracting days moves it backward. If today is July 17, 2026, adding 10 days lands on July 27, 2026, and subtracting 10 days lands on July 7, 2026. Same operation, opposite direction — mathematically it's just a positive or negative number applied to the same date.

The arithmetic gets harder than it looks because months don't all have the same length, and every four years February picks up an extra day. Add 45 days to March 10 by hand and you have to track exactly where March ends and April begins, then do the same for April into May. Miss a month boundary or a leap year and the answer is off by a day.

That's why most people use a calculator, a spreadsheet formula, or a line of code rather than counting on a physical calendar — especially when the same calculation has to run across dozens or hundreds of rows in a dataset.

How to Add or Subtract Days From a Date Manually

The process is identical for both directions — you're just moving through the calendar forward or backward.

Side-by-side example of adding and subtracting 40 days from April 5 2026

Subtracting: April 5, 2026 minus 40 days

  • April 5 minus 5 days reaches March 31 (the last day of March), using 5 of the 40 days. 35 remain.
  • March has 31 days — subtract those, landing on February 28, 2026 (not a leap year). 4 days remain.
  • February 28 minus 4 days lands on February 24, 2026.

Adding: April 5, 2026 plus 40 days

  • April has 30 days, so April 5 plus 25 days reaches April 30, using 25 of the 40 days. 15 remain.
  • May 1 plus 14 more days lands on May 15, 2026.

Three things trip people up either direction:

  • Leap years. 2024 and 2028 have a February 29; 2025, 2026, and 2027 don't. A year is a leap year if it's divisible by 4, except century years, which must also be divisible by 400.
  • Month-end edge cases. Moving from the 31st of a month into a 30-day or 28-day month, or vice versa, needs care since there's no exact equivalent day.
  • Time zones, if you're working with timestamps rather than plain dates. Adding or subtracting days from a full timestamp near midnight can shift across a day boundary depending on the time zone in use.

Business Days vs. Calendar Days

Comparison table of calendar days versus business days for date calculations

Not every "add or subtract days" question is about the calendar. A lot of real deadlines — notice periods, project timelines, payment terms — are counted in business days, which skip weekends and sometimes public holidays.

Calendar DaysBusiness Days
Includes weekendsYesNo
Includes public holidaysYesUsually excluded
Typical usePersonal planning, medical timelinesContracts, payroll, legal notice periods
Excel functionSimple +/-WORKDAY (add/subtract)

If a contract says "30 days' notice," confirm whether that means calendar days or business days before calculating either direction — the two can land 8–10 days apart depending on how many weekends fall in the range.

Add or Subtract Days in Excel

Excel formulas adding and subtracting 30 days from a date in column A

Excel stores every date as a serial number — January 1, 1900 is day 1 — which is what makes date arithmetic possible with simple + and - operators.

Subtract: =A2-30
Add: =A2+30

Both subtract 30 days from, or add 30 days to, the date in cell A2. If the result displays as a raw number instead of a date, select the cell, press Ctrl+1, and set the format to Date.

Cell reference for day count: =A2-B2 (subtract) / =A2+B2 (add)
Business days only: =WORKDAY(A2,-30) to subtract / =WORKDAY(A2,30) to add

Add a third argument to exclude public holidays: =WORKDAY(A2,-30,Holidays).

Count business days between two dates: =NETWORKDAYS(B2,A2)
Days between two dates: =A2-B2 or =DATEDIF(B2,A2,"d")
Add years, months, and days: =DATE(YEAR(A2)+1,MONTH(A2)+2,DAY(A2)+15)

Add or Subtract Days in Google Sheets

Google Sheets uses the same serial-number system as Excel, so the syntax is nearly identical.

Subtract: =A2-30
Add: =A2+30
Business days: =WORKDAY(A2,-30) or =WORKDAY(A2,30)
Days between two dates: =DATEDIF(B2,A2,"D")

Format the result as a date via Format → Number → Date if it displays as a raw number.

Add or Subtract Days in JavaScript

Native JavaScript Date objects handle both directions with one function — a positive or negative number:

result.setDate(result.getDate() + days) // positive = add, negative = subtract
Day.js subtract: dayjs("2026-07-17").subtract(30, "day")
Day.js add: dayjs("2026-07-17").add(30, "day")
date-fns subtract: subDays(new Date("2026-07-17"), 30)
date-fns add: addDays(new Date("2026-07-17"), 30)
Luxon subtract: DateTime.fromISO("2026-07-17").minus({ days: 30 })
Luxon add: DateTime.fromISO("2026-07-17").plus({ days: 30 })

Add or Subtract Days in Python

Python's datetime module uses timedelta for both directions:

from datetime import date, timedelta
start_date - timedelta(days=30) # subtract
start_date + timedelta(days=30) # add

With pandas, useful for shifting an entire column of a DataFrame:

df["reminder"] = df["due_date"] - pd.Timedelta(days=30)
df["renewal"] = df["due_date"] + pd.Timedelta(days=30)

Add or Subtract Days in SQL

Syntax varies by database engine:

SQL Server: DATEADD(day, -30, col) / DATEADD(day, 30, col)
MySQL: DATE_SUB(col, INTERVAL 30 DAY) / DATE_ADD(col, INTERVAL 30 DAY)
PostgreSQL: col - INTERVAL '30 days' / col + INTERVAL '30 days'
BigQuery: DATE_SUB(col, INTERVAL 30 DAY) / DATE_ADD(col, INTERVAL 30 DAY)
Athena / Presto: date_add('day', -30, col) / date_add('day', 30, col)
DB2: col - 30 DAYS / col + 30 DAYS

Across every engine, a negative number (or -INTERVAL) subtracts and a positive one adds — the function name and argument order are what changes.

Add or Subtract Days in C#

DateTime startDate = new DateTime(2026, 7, 17);
DateTime earlier = startDate.AddDays(-30); // subtract
DateTime later = startDate.AddDays(30); // add
int daysBetween = (date1 - date2).Days;

AddDays() handles both directions — a negative number subtracts, a positive number adds. There is no separate SubtractDays() method.

Other Languages

  • PHP (strtotime): date("Y-m-d", strtotime("2026-07-17 -30 days")) or "+30 days" to add
  • PowerShell: (Get-Date "2026-07-17").AddDays(-30) or .AddDays(30)
  • Carbon (PHP library): Carbon::parse("2026-07-17")->subDays(30) or ->addDays(30)

The "one method, positive or negative number" pattern shows up across almost every mainstream language and library.

Common Mistakes When Adding or Subtracting Days

  • Forgetting leap years in manual calculations. A miscount of even one day compounds if you're chaining multiple date shifts.
  • Confusing calendar days with business days. A "14 days" notice period reads very differently if it's meant to exclude weekends.
  • Mixing up date-only and date-time values in code. Shifting a full timestamp near midnight can land on the wrong calendar day if time zones aren't handled consistently.
  • Excel/Sheets showing a serial number instead of a date. This is a formatting issue, not a formula error — reformat the cell rather than rewriting the formula.
  • Using the wrong SQL function for the database engine. DATEADD works in SQL Server but not MySQL — copying a formula between engines without checking is a common source of syntax errors.
  • Sign errors when subtracting. Typing + instead of - (or a positive instead of negative interval) is the single most common mistake across every platform covered here.

Real-World Uses

  • Contracts and legal notices: counting backward from a deadline to find the last day notice can be served, or counting forward from a signing date to set a renewal date.
  • Payroll and HR: calculating probation-period end dates by adding days to a hire date, or reminder dates by subtracting days from a review date.
  • Medical timelines: estimating a conception date by subtracting roughly 280 days from a due date, or scheduling a follow-up by adding a set number of days to a procedure date.
  • Project management: working backward from a launch date to set milestone deadlines, or forward from a kickoff date to a delivery date.
  • Finance: subtracting days from an invoice date for early-payment windows, or adding days for a payment-due date.
  • Personal planning: working out when to mail a card so it arrives before a birthday (subtract), or when a subscription renews (add).

Frequently Asked Questions

Subtract the day count directly from the date cell: =A2-30. Add days the same way with =A2+30. Format the result cell as Date via Ctrl+1 if it shows as a raw number.
In Excel or Google Sheets, use WORKDAY(start_date, ±number_of_days). Add a holiday range as a third argument to also exclude specific public holidays.
Yes — the calculator handles leap years and variable month lengths automatically. Leap years only cause errors in manual, by-hand calculations.
Calendar days count every day including weekends and holidays. Business days skip weekends — so 30 business days is typically 40–42 calendar days.
Use timedelta: date - timedelta(days=30) to subtract or date + timedelta(days=30) to add. Both work with Python's built-in datetime module.
Excel stores dates as serial numbers. Select the cell, open Format Cells (Ctrl+1), and choose Date. This is a formatting issue, not a formula error.
In Excel/Sheets, use EDATE(start_date, ±months) for months. In Python, use dateutil.relativedelta, since timedelta only works in days.