0% found this document useful (0 votes)
63 views

Calculate Difference Between Dates

Here are the steps to solve the problem: 1) Subtract the start and end dates to get the difference in years, months, and days: Start Date: 1/1/2014 End Date: 5/6/2016 Difference: 2 years, 4 months, 5 days 2) Use the NETWORKDAYS.INTL function to calculate the number of workdays between two dates excluding weekends and holidays: Start Date: 1/1/2016 End Date: 12/31/2016 Holidays: Named range "MyHolidays" Result: 252 workdays 3) Subtract times to get the difference in hours and minutes: Start Time: 7:15

Uploaded by

Talk 2me
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Calculate Difference Between Dates

Here are the steps to solve the problem: 1) Subtract the start and end dates to get the difference in years, months, and days: Start Date: 1/1/2014 End Date: 5/6/2016 Difference: 2 years, 4 months, 5 days 2) Use the NETWORKDAYS.INTL function to calculate the number of workdays between two dates excluding weekends and holidays: Start Date: 1/1/2016 End Date: 12/31/2016 Holidays: Named range "MyHolidays" Result: 252 workdays 3) Subtract times to get the difference in hours and minutes: Start Time: 7:15

Uploaded by

Talk 2me
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Find the difference in years: Start date End date

1/14/2014 5/6/2016

Find the difference in months: Start date End date


1/1/2014 5/6/2016

Find the difference in days: Start date End date


1/1/2014 5/6/2016

Find the difference in weeks: Start date End date


1/1/2014 5/6/2016

Calculate age in accumulated


years, months and days: Start date End date
1/1/2014 5/6/2016

All in one:

Tip: Press ALT+ENTER to put line breaks in your formula.


Also, press CTRL+SHIFT+U if you can’t see the whole formula.

Calculate the difference between


today and another date: End date
12/31/3000

Calculate workdays, with


or without holidays: First, make a list of all holidays in a separate area.
Make sure each date is in its own cell.

Holidays
1/1/2016 9/5/2016
1/18/2016 10/10/2016
2/15/2016 11/11/2016
5/30/2016 11/24/2016
7/4/2016 12/25/2016

After you put each holiday in its own cell,


select those cells. Then go to Formulas > Define Name.
Name the range, and click OK.

Note: We have done this already in this workbook.


We named the range, "MyHolidays." You can see
the name by going to Formulas > Name Manager.

In this example, the NETWORKDAYS.INTL


function calculates the number of workdays:
Start date End date
1/1/2016 12/31/2016

In Excel 2007, you can use the NETWORKDAYS


function to calculate the number of workdays:
Start date End date
1/1/2016 12/31/2016

If you want your holidays inside a formula,


you can use extra brackets, quotes, and commas.

This highlighted cell shows an example


of 2 holiday dates within the formula:
Start date End date
1/1/2016 12/31/2016

And here's an Excel 2007 example of


of 2 holiday dates within the formula:
Start date End date
1/1/2016 12/31/2016

Calculate the difference


between two times: Start time End time
7:15 AM 4:30 PM

Calculate the difference


between two times: Start date/time End date/time
1/1/16 1:00 PM 1/1/16 2:00 PM

qr 1/1/16 9:00 PM 1/1/16 1:00 PM


qs 1/1/16 9:00 PM 1/1/16 11:00 PM

This document is provided “as is.” Information and views expressed in this document, including URLs and other
Internet Web site references, may change without notice.

Some examples depicted herein are provided for illustration only and are fictitious. No real association or connection
is intended or should be inferred.

This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You
may copy and use this document for your internal, reference purposes.

This document may be available in English only. Clicking embedded links may redirect you to a website whose content
is in English.

Microsoft, Excel, Internet Explorer, and Windows are trademarks of Microsoft Corporation. All other trademarks are
property of their respective owners.
Result
2

Result
28

Result
856

Make sure to format this particular result as a number.


Result Press CTRL + 1, and then select Number > Decimal places: 2
122.29

Result Unit of time


2 years
4 months
5 days
2 years, 4 months, 5 days
Use ampersands, quotes, spaces and text to put all three age
calculations in one cell. It's a longer formula to type, but at least
put line breaks in your formula.
all three results are combined into one cell.
U if you can’t see the whole formula.

Result
979
Putting TODAY() in the formula allows you to find the difference
between the current day of your computer, with the end date of
12/31/3000. The date of TODAY() will change if you open the file
lidays in a separate area.
on a future day.
n its own cell.

ay in its own cell,


o to Formulas > Define Name.
already in this workbook.
MyHolidays." You can see
rmulas > Name Manager.

WORKDAYS.INTL
umber of workdays:
The "1" parameter tells NETWORKDAYS.INTL to exclude
Result weekend days of Saturdays and Sundays. But you can use "2"
252 for Sunday and Monday, "3" for Monday and Tuesday, and so
on. To see all possible parameters, delete the "1" from this
e the NETWORKDAYS formula and pick from the list.
In Excel 2007, this cell will return the #NAME? error.
number of workdays:
Result
In Excel 2007, you must use the NETWORKDAYS function. This
252 function doesn't have weekend parameters. It always assumes
that your weekends are on Saturdays and Sundays.

s inside a formula,
ts, quotes, and commas.

ws an example
the formula:
Result
260

example of
the formula:
Result
260

Difference
9:15

Difference
1:00

-8:00 8:00
2:00

ssed in this document, including URLs and other

ly and are fictitious. No real association or connection

y intellectual property in any Microsoft product. You


urposes.

ded links may redirect you to a website whose content

ks of Microsoft Corporation. All other trademarks are


ular result as a number.
Number > Decimal places: 2

s and text to put all three age


nger formula to type, but at least
nto one cell.

allows you to find the difference


ur computer, with the end date of
Y() will change if you open the file
ORKDAYS.INTL to exclude
Sundays. But you can use "2"
Monday and Tuesday, and so
ers, delete the "1" from this
he #NAME? error.

NETWORKDAYS function. This


parameters. It always assumes
urdays and Sundays.
start finish Masa Dicatat
8:00 11:20 03:20:00 AM

Soalan 1: BAS Masa diambil


2:50
Jam betolak
8:30

Masa perjalanan Masa Sampai Masa Betolak


Soalan 2: Keretapi A-B 5:50 13:50 7:00
B-A 4:40 12:40 8:00

2:55 9:55
2:20 10:20
TOLAK 1 1 0
TAMBAH 1 1 2
BAHAGI 110 5 22
DARAP 1 1 1
TOLAK 1 1 0
TAMBAH 1 1 2
BAHAGI 110 5 22
DARAP 1 1 1

You might also like