Formulate-Excel-Data-using-Date-Time-formulas
Formulate-Excel-Data-using-Date-Time-formulas
Excel data
using Date &
Time formulas
Welcome to TechLounge Training
Ellie Stiller
September 22, 2022
Agenda
1 4
What is it? DATEDIF
2 5
Understanding the logic TODAY
3 6
DATE NOW
2
Agenda
10
TIMEDIF
7
WORKDAY
11
NETWORKDAYS
8
WEEKDAY
9
WEEKNUM
3
Definition:
What is it?
Date and Time formulas allows you to perform calculations that involve date and time.
Example:
Note:
the Logic • The order in which you insert a formula is important. Each formula has a specific order
called the Syntax which must be followed for the formula to work correctly.
• The basic Syntax to create a formula is to insert an equal sign (=), followed by the
formula name (telling Excel what type of calculation you would like to perform),
followed by the argument (telling Excel where it needs to calculate the information).
Example: =sum(b3:b12)
5
Definition:
DATE
Use the DATE formula when you need to take three separate values and combine them to
form a date.
Activity 1:
=DATE(F2,B2,D2)
*Cell format must be set to Short Date
6
Definition:
DATEDIF
Use the DATEDIF formula to calculate the number of days, months, or years between two
dates. The DATEDIF formula is useful when you need to calculate an age.
Activity 2:
=DATEDIF(A2,B2,"Y")
7
Activity 3:
DATEDIF
Using the DATEDIF formula, calculate the employment duration in days.
=DATEDIF(A2,B2,"D")
8
Definition:
TODAY
Use the TODAY formula to display the current date on a worksheet (regardless of when
you open the workbook). The TODAY formula syntax has no arguments.
Activity 4:
=TODAY()
9
Definition:
NOW
Use the NOW formula to display the current date and time on a worksheet (regardless of
when you open the workbook). The NOW formula syntax has no arguments.
Activity 5:
Using the NOW formula, calculate the current date & time.
=NOW()
10
Definition:
TODAY
Use the TODAY formula to display the current date on a worksheet (regardless of when
you open the workbook). The TODAY formula syntax has no arguments.
Activity 6:
Using the TODAY formula, calculate the contract due date in days.
=C10-TODAY()
*Cell format must be set to General
11
Activity 7:
TODAY
Using the TODAY formula, calculate the contract age in years.
=INT(YEARFRAC(D10,TODAY()))
*Cell format must be set to General
*INT rounds a number down to the nearest integer
*YEARFRAC returns the year fraction representing the number of whole days
between the start_date and end_date
12
Definition:
WORKDAY
Use the WORKDAY formula to calculate a date that is a given number of working
days ahead of or prior to the start date. It excludes weekends as well as any
holidays you specify.
Activity 8:
Using the WORKDAY formula, calculate the estimated project completion date..
=WORKDAY(B2,C2,$F$3:$F$11)
13
Definition:
WEEKDAY Use the WEEKDAY formula to convert a date to display the day of the week.
Activity 9:
=WEEKDAY(B2,1)
*Cell format must be set to ddd
*Serial number must be a date
*By default, your weekday will start on a Sunday and run through till Saturday
14
Definition:
WEEKNUM
Use the WEEKNUM formula to find the week number for a given date in that particular year.
Activity 10:
Using the WEEKNUM formula, calculate the week number for each Purchase Date in 2020.
=WEEKNUM(B2,1)
*Cell format must be set to General
*Serial number must be a date
*By default, your weekday will start on a Sunday and run through till Saturday
15
Definition:
TIMEDIF
Use the TIMEDIF formula to calculate the difference in hours between the start and end time.
Activity 11:
Calculate the total hours worked per day for each employee, considering that some
employees may work the night shift.
=C2-B2+(B2>C2)
*Cell format must be set to h:mm
*If you use the 24-hour clock Excel knows it is AM / PM
*If you don’t enter AM / PM Excel will assume it’s AM
16
NETWORKDAYS Definition:
Use the NETWORKDAYS formula to calculate the number of whole working days between
a start date and end date by excluding weekends and any dates identified as holidays.
Activity 12:
Using the NETWORKDAYS formula, calculate the number of working days required to
complete each project task.
=NETWORKDAYS(B2,D2,$F$3:$F$11)
17
Q&A
18