Google Sheets Test Google Sheets Date and Time Functions Questions and Answers 2 — Questions and Answers
Question 1: What does the DATEDIF function calculate in Google Sheets?
- The sum of two date values
- The difference between two dates in a specified unit (Correct answer)
- The formatted display of a date
- The number of weekdays in a month
Correct answer: The difference between two dates in a specified unit
DATEDIF(start_date, end_date, unit) calculates the difference between two dates in units such as years, months, or days.
Question 2: Which function adds a specified number of months to a date in Google Sheets?
- DATEADD()
- ADDMONTHS()
- EDATE() (Correct answer)
- MONTHSHIFT()
Correct answer: EDATE()
EDATE(start_date, months) returns a date the specified number of months before or after the start date.
Question 3: What does the HOUR() function extract from a time or datetime value?
- Minutes past the hour
- The hour as a number between 0 and 23 (Correct answer)
- The hour as a 12-hour value
- The total hours since midnight
Correct answer: The hour as a number between 0 and 23
HOUR(time) returns the hour component of a time value as an integer from 0 (midnight) to 23.
Question 4: Which function converts a text string representing a date into an actual date value in Google Sheets?
- TODATE()
- DATEVALUE() (Correct answer)
- CONVERT()
- TEXTTODATE()
Correct answer: DATEVALUE()
DATEVALUE(date_string) converts a date stored as text into a numeric date serial that Google Sheets can use in calculations.
Question 5: What does the EOMONTH function return in Google Sheets?
- The first day of a given month
- The last day of a month offset by a number of months (Correct answer)
- The middle day of the month
- The total days in a month
Correct answer: The last day of a month offset by a number of months
EOMONTH(start_date, months) returns the last day of the month that is a specified number of months from the start date.
Question 6: Which DATEDIF unit returns the number of complete months between two dates?
- "D"
- "Y"
- "M" (Correct answer)
- "W"
Correct answer: "M"
Using "M" as the unit in DATEDIF returns the number of complete calendar months between the start and end dates.
What does the DATEDIF function calculate in Google Sheets?