TIME Function Examples – Excel, VBA, & Google Sheets
Written by
Reviewed by
Download the example workbook
This tutorial demonstrates how to use the TIME Function in Excel to calculate a time.
TIME Examples
The TIME Function is used to create times by entering a hour, minute, and second:
=TIME(B3,C3,D3)
TIME – HOUR, MINUTE, SECOND Functions
Often the TIME Function is used along with HOUR, MINUTE, or SECOND Functions to calculate a time based on another time.
This example will return a time 8 hours after another time:
=TIME(B3+8,C3,D3)
Time – Fraction of Day
TIME values are stored as a decimal value in Excel:
TIME in Google Sheets
The TIME Function works exactly the same in Google Sheets as in Excel:
TIME Examples in VBA
You can also use the TIME function in VBA. Type:
application.worksheetfunction.time(hour,minute,second)
For the function arguments (hour, etc.), you can either enter them directly into the function, or define variables to use instead.