TIME Function Examples – Excel, VBA, & Google Sheets

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on November 6, 2023
Download Example Workbook

Download the example workbook

This tutorial demonstrates how to use the TIME Function in Excel to calculate a time.

TIME Main Function

TIME Examples

The TIME Function is used to create times by entering a hour, minute, and second:




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 – Fraction of Day

TIME values are stored as a decimal value in Excel:

TIME Value

TIME in Google Sheets

The TIME Function works exactly the same in Google Sheets as in Excel:

TIME Google Sheet

TIME Examples in VBA

You can also use the TIME function in VBA. Type:


For the function arguments (hour, etc.), you can either enter them directly into the function, or define variables to use instead.

AI Formula Generator

Try for Free

Excel Practice Worksheet

practice excel worksheet

Practice Excel functions and formulas with our 100% free practice worksheets!

  • Automatically Graded Exercises
  • Learn Excel, Inside Excel!

Free Download

Return to List of Excel Functions