Get help

Help center

Guides and answers

Contact support

Write to our team

Sign in to

Workflows

Build processes with your team

Automations

Connect files and automate tasks

One system, four parts

AI agents

Virtual Employees that work 24/7

Automations

Connect files and automate tasks

Workflows

Build processes with your team

Data Space

Trusted data sharing and control

Solutions by department

Finance

Reports, budgets, and reconciliations

Inventory and manufacturing

Stock, orders, and production in one view

HR

Timesheets, attendance, and reviews

Project management

Status and workload across projects

Sales and CRM

Leads and deals kept up to date

Education

Student records and school data

Finance

Turn manual finance work into reports that update themselves.

What Finance teams automate

  • Track payables and receivables
  • Build cash flow statements
  • Compare budget against actuals

Inventory and manufacturing

See stock levels and automate ordering.

What inventory and manufacturing teams automate

  • Track inventory across multiple sites
  • Connect sales, purchasing, and warehouse data
  • Link a barcode scanner to your sheet

HR

Run recruitment, attendance, and OKR tracking from your sheets.

What HR teams automate

  • Track recruitment and onboarding
  • Record team OKRs and results
  • Track check-ins, check-outs, and leave

Project management

Assign tasks and track hours without manual updates.

What project teams automate

  • Assign tasks and track status changes
  • Estimate effort and log hours worked
  • Track milestones across projects

Sales and CRM

Track leads and sales performance with automated reports.

What sales teams automate

  • Track and convert leads
  • Set sales goals and track team metrics
  • Monitor sales KPIs on dashboards

Education

Automate attendance, grades, and school purchasing.

What schools automate

  • Track attendance and notify parents
  • Record and compare class grades
  • Track inventory lent to students and staff

Find a use case

By department

How each team uses Sheetgo

By industry

How each industry uses Sheetgo

By company size

Small, medium-sized, or large

Learn

Blog

Guides and product news

Customer stories

How teams like yours use Sheetgo

Help center

Guides and answers

Why Sheetgo

Compare

How Sheetgo compares with other tools

Security

How we protect your data

Trust center

Our compliance details

Sign in to

Workflows

Build processes with your team

Automations

Connect files and automate tasks

One system, four parts

AI agents

Virtual Employees that work 24/7

Automations

Connect files and automate tasks

Workflows

Build processes with your team

Data Space

Trusted data sharing and control

Solutions by department

Finance

Reports, budgets, and reconciliations

Inventory and manufacturing

Stock, orders, and production in one view

HR

Timesheets, attendance, and reviews

Project management

Status and workload across projects

Sales and CRM

Leads and deals kept up to date

Education

Student records and school data

Find a use case

By department

How each team uses Sheetgo

By industry

How each industry uses Sheetgo

By company size

Small, medium-sized, or large

Get started

Templates

Ready-made workflows to start from

Learn

Blog

Guides and product news

Customer stories

How teams like yours use Sheetgo

Help center

Guides and answers

Why Sheetgo

Compare

How Sheetgo compares with other tools

Security

How we protect your data

Trust center

Our compliance details

Help center

Guides and answers

Contact support

Write to our team

Workflows

Build processes with your team

Automations

Connect files and automate tasks

How to use the DATEDIF formula in Google Sheets

In Google Sheets, if we need to know how far two different dates are separated from each other, we can make use of the DATEDIF formula. It stands for “Date Difference”. Depending on the specified unit type, the output is in either number of days, months or years.

Syntax

DATEDIF(start_date, end_date, unit)

  • start_date – the date which the formula calculates the ‘date difference’ from. This input has to be date type data, which we can ensure either by using DATE type returning functions or by using references to the cells that have dates.
  • end_date – the date until which the formula calculates the ‘date difference’ to. Just like the start_date, this too has to be date type data.
  • unit – this parameter indicates the DATEDIF formula which among the following measurement means the output should be displayed in.
DATEDIF formula 1

Usage: DATEDIF Formula

Nothing makes our understanding of a concept better than a set of few examples. Please consider the following snapshot.

DATEDIF formula 2

Let’s have a look at the first case (row # 2). The DATEDIF formula accepted two date cells references for its start_date and end_date parameters. And since its unitparameter is “D”, it should give us the number of days between start_date and end_date. True to the definition, it returned 125 as output. To validate this let us do a simple count of days it takes to reach 06-May-2017 from 01-Jan-2017. Leaving alone 01-Jan-2017, it is 30 days in January, 28 days in February, 31 days in March, 30 days in April and 6 days in May. So put together, it is 125 days.

Moving on to the second case, the input dates remain the same, albeit taken in the form of DATE functions. The difference is with the unit parameter, which is “M” in this example. So, it is set out to give us the number of whole months that elapsed from 01-Jan-2017 to 06-May-2017. Validating this quickly, we’ll notice that only the months Jan, Feb, Mar and Apr have elapsed completely. So the output should be 4, which the formula dutifully returned.

For the third example, we used a different means of expressing a date for start_date parameter, which the formula is okay with. While the end_date parameter is a regular reference to a date cell. The unit is “Y”, therefore the formula returns the number of whole years that have elapsed from 01-Jun-2001 to 06-May-2017.

Curious cases of “MD”, “YM” and “YD”…

Moving further to the fourth case – you’ll notice we’ve used yet another valid form of date value for start_date parameter. Given the value “MD” for its unit parameter, it should give us the number of days having subtracted any number of whole months that have elapsed. So, the DATEDIF formula ignores days from all the elapsed months starting from 01-Jun-2001 to 01-May-2017. How many days does it take from 01-May-2017 to 06-May-2017? 5 it is, and rightly so, as per the result in this example.

“YM” unit in the fifth example ensures the output is in months after ignoring any whole years elapsed after start_date and before end_date. So the formula ignores all the whole years from 02-Feb-2002 till 02-Feb-2017. Therefore, 3 is the number of whole months that have elapsed after 02-Feb-2017 and before 31-May-2017.

The sixth example uses the same start_date and end_date values as that of its fifth counterpart. Except, the unit here is “YD”. So it should give us the output in a number of days after not considering years elapsed between the specified dates. So after ignoring all the years elapsed between 02-Feb-2002 to 02-Feb-2017, the number of days it takes to reach 02-Feb-2017 to 31-May-2017 is 119.

You may also like…

google sheets features and formulas

How to find nominal interest rate using Google Sheets

Sarah is a young professional making significant financial decisions. From credit cards to mortgages, student loans, and investment...
google sheets features and formulas

Pull Google Calendar data into Google Sheets using Apps Script

This post was originally published in our community forum. Objective : This guide demonstrates how to use Google Apps Script to pull data...
google sheets features and formulas

Using the PROPER function to capitalize the first letter of each word in Google Sheets

Note: This post was originally published in our community forum. Ever found yourself needing to clean up a list of names, titles, or any...