Working with Date and Time in Excel

Get FREE Advanced Excel Exercises with Solutions!

We need to use date and time in Excel for various functions and formatting. Excel date and time functionality involves handling and manipulating dates and times within Excel.

Excel stores dates as serial numbers and times as fractional values of a day. Every date is assigned a unique serial number starting from January 1st, 1900 which is denoted by 1. January 2nd, 1900 holds a numeric value of 2.

In this article, we will discuss 6 ways to insert and perform calculations on date and time in Excel.


1. Inserting Date and Time

We can insert the date and time differently within Excel worksheets such as: manually, using keyboard shortcuts, and using Excel functions.

1.1. Manually Insert Date and Time

We can manually insert the date and time in two different ways. The manually inputted date and time do not update automatically.

To insert the date and time manually,

  • Select cell C5 and manually insert the date and time.

manually insert the date and time

Alternatively, we can also insert the date and time using keyboard shortcuts:

  • Ctrl + Shift + ;(semi-colon) inserts the current time.

using keyboard shortcut to insert time

  • Ctrl + ;(semi-colon) inserts the current date.

using keyboard shortcut to insert date

1.2. Using TODAY Function to Insert Date

The main benefit of using functions to insert date and time is that the time and date update automatically when there are any changes made within the sheet. This is useful for creating dynamic reports and dashboards.

The two functions to insert date and time are the TODAY function.

The TODAY function inserts the current date.

Suppose we have a dataset. Conference A starts today. We can use the TODAY function to display the date. For this:

  • Go to cell C5.
  • Insert TODAY function: =TODAY()

select cell and insert TODAY function


2. Inserting Timestamp in Excel

Inserting a timestamp in Excel allows us to track and manipulate data based on specific time intervals, such as minutes, hours, days, etc.

We can insert timestamps manually, using keyboard shortcuts and using Excel functions.

The NOW function that we have used already, can insert the current time along with the date which is quite useful for inserting timestamps.

To insert the timestamp follow the steps below.

  • Select cell C4.
  • Insert the NOW function: =NOW()

insert NOW function for timestamp

Note: The date and time update automatically when there are any changes made within the sheet.

Alternatively, we can use the keyboard shortcuts that require manual intervention each time we want to insert a timestamp.

  • Press Ctrl + Shift + ;(semi-colon) to insert the current time.
  • Press Ctrl + ;(semi-colon) to insert the current date.

3. Adding Date and Time

Adding date and time is useful for calculating durations for projects and working hours.

3.1. Adding Days with Dates

We can add days to dates in different ways. The simplest way to add days to date is by using cell reference.

  • To add 5 days to the date in cell B5, we can use the formula: =C5+5

add days to date using cell reference

We can use the DATE function to add days to a date. The DATE function can take an input and convert it to date.

  • For this, use the following formula: =DATE(2024,2,17)+5

add days to date using DATE function

  • This function adds 5 days to the date 2/17/2024 and returns the result.
  • We can also use the TODAY function to add days to today’s date.
    • The following formula adds 5 days to today’s date: =TODAY()+5

add days to date using TODAY function

3.2. Adding Times

We can use the TIME function to add time to a specific time.

  • To add specific time to the time in cell B5, use the following formula: =C5+TIME(8,5,0)
  • This adds 8 hours and 5 minutes to the time in cell C5.

adding times


4. Subtracting Date and Time

Subtracting date and time is useful for calculating durations, managing deadlines, etc.

4.1. Subtracting Days from Dates

Subtracting days to date is similar to adding days to dates. This returns a date as the result.

  • To subtract 5 days from the date in cell D5, we need to use the formula: =D5-5

subtract days from date using cell reference

  • We can use the DATE function to subtract days from a date.
  • The following formula subtracts 5 days from the date 2/17/2024: =DATE(2024,2,17)-5

subtract days from date using DATE function

  • To subtract 5 days from today’s date: =TODAY()-5

subtract days from date using TODAY function

4.2. Subtracting Date from Another Date

Subtracting a date from another date returns the duration.

  • The following formula returns the result of subtraction between the two dates: =DATE(2024,2,12)-DATE(2024,2,7)

subtract date from another date using DATE function

  • A similar result can be achieved using cell reference: =C5-B5

subtract date from date

4.3. Subtracting Time

The TIME function allows us to easily subtract time.

  • To subtract time from the time in cell D5, use the following formula: =D5-TIME(8,5,0)
  • This subtracts 8 hours and 5 minutes from the time in cell D5.

subtracting time


5. Changing the Date and Time Format

Changing the date and time format is essential for displaying the date and time in a more visually appealing way.

To change the date or time format:

  • Select a cell or a range of cells and press Ctrl + 1.
  • This brings out the Format Cells dialog box.
  • Go to the Number tab on the Format Cells dialog box.
  • Select Date or Time under Category.
  • Select a type, and click on OK.

change date and time format


6. Converting Time Zones in Excel

Time zones are most important to know the actual time of different places to another location. In Excel, there is no direct formula to convert time zones. For this, we can use the MOD function to convert time zones.

For this, we have a dataset with times of different areas and adjustments. The adjustment denotes how much time has to be added or subtracted from the GMT to get the time of that particular area.

  • Go to a cell and insert the following formula: =MOD(C4+(E4/24),1)
    C5 is the time to convert
    E5 is the adjustment time

convert time zones


Frequently Asked Questions

What is the Excel formula for date and time?

The TODAY function shows the current date and the NOW function shows the current time along with the date. These are the default formulas in Excel for date and time.

How do I insert the date and time together in Excel?

The NOW function inserts the current date and time together in Excel.


Conclusion

This article describes everything about date and time in Excel. We discussed how to insert the date and time, and how we can change the formatting of the date and time. We have also discussed the method of inserting timestamps and the way to convert time zones.


Excel Date Time: Knowledge Hub


<< Go Back to Learn Excel

What is ExcelDemy?

ExcelDemy - Learn Excel & Get Excel Solutions Center provides online Excel training , Excel consultancy services , free Excel tutorials, free support , and free Excel Templates for Excel professionals and businesses. Feel free to contact us with your Excel problems.

Tags:

Maruf Niaz
Maruf Niaz

Md. Maruf Niaz, BSc, Textile Engineering and Management, Bangladesh University of Textiles, has worked with the ExcelDemy project for 11 months. He works as an Excel and VBA Content Developer who provides authentic solutions to Excel-related problems and regularly writes fantastic content articles. He has published almost 20 articles in ExcelDemy. As an Excel & VBA Content Developer for ExcelDemy, he offers solutions to complex issues. He demonstrates an enthusiastic mindset and adeptness in managing critical situations with... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo