0
0
Google Sheetsspreadsheet~20 mins

DATEDIF for differences in Google Sheets - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DATEDIF Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📊 Formula Result
intermediate
2:00remaining
Calculate full months between two dates
Given the start date in cell A1 as 2023-01-15 and the end date in cell B1 as 2023-04-10, which formula correctly calculates the number of full months between these dates using DATEDIF?
A=DATEDIF(A1, B1, "M")
B=DATEDIF(B1, A1, "M")
C=DATEDIF(A1, B1, "D")
D=DATEDIF(A1, B1, "Y")
Attempts:
2 left
💡 Hint
Remember that the third argument in DATEDIF specifies the unit: "M" for months, "D" for days, "Y" for years.
📊 Formula Result
intermediate
2:00remaining
Calculate days excluding years and months
If cell A1 contains 2022-12-01 and cell B1 contains 2023-02-15, which formula returns the number of days excluding full years and months between these dates?
A=DATEDIF(A1, B1, "MD")
B=DATEDIF(A1, B1, "YD")
C=DATEDIF(A1, B1, "YM")
D=DATEDIF(A1, B1, "D")
Attempts:
2 left
💡 Hint
The "MD" unit returns days ignoring months and years.
Function Choice
advanced
2:30remaining
Find the formula for total years and leftover months
You want to calculate the total full years and leftover months between two dates in cells A1 and B1. Which pair of formulas correctly gives the years and leftover months respectively?
AYears: =DATEDIF(A1, B1, "Y") and Months: =DATEDIF(A1, B1, "MD")
BYears: =DATEDIF(A1, B1, "M") and Months: =DATEDIF(A1, B1, "MD")
CYears: =DATEDIF(A1, B1, "YD") and Months: =DATEDIF(A1, B1, "MD")
DYears: =DATEDIF(A1, B1, "Y") and Months: =DATEDIF(A1, B1, "YM")
Attempts:
2 left
💡 Hint
Use "Y" for full years and "YM" for leftover months ignoring years.
🎯 Scenario
advanced
2:00remaining
Identify the error in this DATEDIF formula
A user writes the formula =DATEDIF(B1, A1, "M") where A1 is the start date and B1 is the end date. What will happen when this formula is used?
AIt returns a negative number of months.
BIt returns a #NUM! error because the start date is after the end date.
CIt returns the number of full months between the two dates correctly.
DIt returns zero regardless of the dates.
Attempts:
2 left
💡 Hint
Check the order of dates in the DATEDIF function.
data_analysis
expert
3:00remaining
Calculate total days excluding full years using DATEDIF
Given start date in A1 as 2019-05-20 and end date in B1 as 2023-08-15, which formula returns the total number of days excluding full years between these dates?
A=DATEDIF(A1, B1, "D") - (DATEDIF(A1, B1, "Y") * 365)
B=DATEDIF(A1, B1, "YM")
C=DATEDIF(A1, B1, "YD")
D=DATEDIF(A1, B1, "MD")
Attempts:
2 left
💡 Hint
The "YD" unit returns days ignoring years.