Time and date maths in Excel

To perform time and date calculations in Excel, you can use various functions and formulas. Here are some commonly used ones:

Current Date and Time

To get the current date, you can use the TODAY() function. It returns the current date as a serial number.

To get the current time, you can use the NOW() function. It returns the current date and time as a serial number.

Date Functions

To add or subtract a specific number of days from a date, you can use the DATE() function. For example, to add 5 days to a date in cell A1, you can use the formula =A1 + 5.

To extract specific components from a date, such as the day, month, or year, you can use the DAY(), MONTH(), and YEAR() functions, respectively.

Time Functions

To add or subtract a specific number of hours, minutes, or seconds from a time, you can use the TIME() function. For example, to add 2 hours to a time in cell B1, you can use the formula =B1 + TIME(2, 0, 0).

To extract specific components from a time, such as the hour, minute, or second, you can use the HOUR(), MINUTE(), and SECOND() functions, respectively.

Date and Time Functions

To calculate the difference between two dates or times, you can use the DATEDIF() function. It returns the difference between two dates or times in a specified interval, such as days, months, or years.

To calculate the number of working days between two dates, excluding weekends and specified holidays, you can use the NETWORKDAYS() function.

Formatting

To display dates and times in a specific format, you can use the formatting options in Excel. Right-click on a cell, select "Format Cells," and choose the desired date or time format from the "Number" tab.

These are just a few examples of the time and date calculations you can perform in Excel. Excel provides a wide range of functions and formulas to handle various time and date scenarios.