You are on page 1of 21

How to Calculate Elapsed Time using Excel Formulas? https://chandoo.

org/wp/elapsed-time-excel/

! Excel Howtos, Learn Excel

Calculate Elapsed Time in Excel [Quick


Tips]
Last updated on September 22, 2009

Share
" ! Facebook " Twitter # LinkedIn

Chandoo

1 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

date and time from which we need to calculate elapsed


Welcome to Chandoo.org
time is in Cell A1.
Thank you so much for visiting. My aim
To calculate the elapsed time in years, use the formula is to make you awesome in Excel &
Power BI. I do this by sharing videos,
=(NOW()-A1)/365 [Help on NOW formula] tips, examples and downloads on this
website. There are more than 1,000
Elapsed time in months pages with all things Excel, Power BI,
Dashboards & VBA here. Go ahead and
To calculate the elapsed time in months, we can use the spend few minutes to be AWESOME.
formula =(NOW()-A1)/30. This returns the value in 30
Read my story • FREE Excel tips
day months. book

Elapsed time in weeks

To calculate the elapsed time in weeks, we use the

formula =(NOW()-A1)/7

Elapsed time in days

To calculate elapsed time in days, the formula is simple =TODAY()-A1. [Help on TODAY formula]

The result includes fractions as well. You can use number formatting to remove the values after

decimal point.

Elapsed time in working days Want an AWESOME


To calculate elapsed time in working days, we can use the NETWORKDAYS formula like this =
Excel Class?
NETWORKDAYS(A1, TODAY()). This formula assumes 5 working days per week starting with Monday.

You can also add an optional list of holidays as a parameter to it.

2 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

But if your working week is not from Monday to Friday, you can try the NETWORKINGDAYS() UDF
Excel School made me great at ⋆!
! ⋆!⋆!

in the same way.
work. ⋆
!

Elapsed time in hours

– Brenda
To calculate elapsed time in hours, we can use the formula =(NOW()-A1)*24

Elapsed time in minutes

To find out elapsed time in minutes, use the formula =(NOW()-A1)*24*60

Elapsed time in seconds


FREE Goodies for you...
In some machine critical scenarios, you might want to find the elapsed time in seconds. Just use the

formula =(NOW()-A1)*24*3600

Download the Elapsed Time Worksheet and see the examples

Click here to download the elapsed time worksheet and play with the examples.

More:

Tips on using date & time in excel, List of excel date & time formulas, More excel quick

tips

100 Excel Formulas List

3 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

Your first name

Your email address


20 Excel Templates
You want to learn
Calendars, invoices, trackers and much
Excel more. All free, fun and fantastic.

Power BI

Get FREE Excel + Power BI Tips


Subscribe
Simple, fun and useful emails, once per week.

Learn & be awesome.

13 Advanced Pivot Table Skills


Power Query, Data model, DAX, Filters,
Slicers, Conditional formats and beautiful
charts. It's all here.

! 41 Comments
# Ask a question or say something...
! Tagged under date and time, downloads, Excel Howtos, Learn Excel, Microsoft Excel Formulas,
networkdays(), networkingdays(), now(), quick tip, spreadsheets, today(), tutorials

! Category: Excel Howtos, Learn Excel

4 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

5 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

6 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

Advanced Data Viz with Excel – Live What is XLOOKUP? 13 formula examples
Event on 26 March to really understand it

7 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

How to embed Excel files, calculators on Dynamic Arrays Live Masterclass –


your website? – Step by step Replay
instructions

8 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

on of its use in Chip Pearson's site :

2.
5 Simple & Useful Conditional Image Lookup – How-to show dynamic
Formatting Tricks picture in a cell [Excel Trick]

Reply

3. L. Quezada says:
September 22, 2009 at 5:31 pm

Oliver:

Yes, I think that DATEDIFF do it better.

Reply

4. Andy says:
September 22, 2009 at 7:31 pm

Great post! This a fantastic tutorial on calculating elapsed time in Excel that could be helpful even
to a novice user. Keep up the useful tips!

Also, the Office community on Facebook could really benefit from you knowledge! Check it out at
http://www.facebook.com/office

Cheers,
Andy
MSFT Office Outreach Team

9 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

for minutes : [m] ==>2793212


for seconds : [s] ==> 167592763

We can also use mean duration for years (orbital period of the Earth around the Sun : i-e tropical
year) which is : 365.25 days
and mean duration for month : 365.25/12 days

be Excelent !!!!

Reply

6. Chandoo says:
September 23, 2009 at 8:57 am

@Oliver... Thanks for the pointer to datediff(). I will update the post with information about this
as well.

@Glen... thanks for the linklove

@Andy... Welcome. Thanks for telling us about the office community on FB.

@Modeste ... that is very cool. I will remember these formatting codes for an upcoming article on
number formatting codes

Reply

7. Tony says:
September 23, 2009 at 12:35 pm

Great tip Chandoo! I use the formula to calculate years elapsed all the time. It can seriously help
save a ton of time with calculations. Also, NETWORKDAYS is one that helps and can seriously
impress a boss. Keep up the great work here!

Reply

8. Andy says:
September 24, 2009 at 10:01 pm

10 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

Hi,
always great posts and a good way to start my day

but regarding the elapsed time calculations: have you never noticed that there is a result
difference between using =TODAY()-A1 and using =NETWORKDAYS(A1,TODAY())?
try it for A1= a Monday such as 21sep09 and "today" is e.g. a Thursday; you get 3 or 4
respectively as a result, depending on the formula used; this is because formula =networkdays()
always includes both the startdate and the end date and not only the time between these 2.
This is easily corrected/compensated bij always adding a -1 to the =networkdays() formula
because the majority of us will count startday as day 0 and then the result will be consistent
across the different formulas.

However, you then get into trouble if you calculate the networkdays for a date further in the past
and where either the start or end date falls in a weekend.

just thought to point this out as to me these formula's are not interchangeable just like that!

have a great day!


Paul

Reply

10. Captn_zee says:


April 26, 2011 at 8:45 am

=DATEDIF([DOJ],TODAY(),"Y") & " Y, " & DATEDIF([DOJ],TODAY(),"YM") & " M, " &
DATEDIF([DOJ],TODAY(),"MD") & " D"

This will fix your 30 Days problem

Reply

11. Amol says:


January 17, 2012 at 5:46 am

I calculated the time diff between two date+ times by subtracting 2 cells & custom formatted it
to "d hh:mm" format.

11 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

Hui... says:
January 18, 2012 at 3:45 am

@Amol
Try the Custom Format code:
[<1] hh:mm ; [>=1] d “d” hh:mm

Reply

12. Ana says:


February 16, 2012 at 3:52 pm

Hi Chandoo,

If possible to compute the interval of time and date in one column.


In column C I would like to compute the total days and hours . What formula ? Please help
Example.
Column A Column B
2/13/12 3:30 AM 2/14/12 12:00 AM

Reply

13. Prasad DN says:


March 1, 2012 at 8:12 pm

In referenc to Elapsed time in months

To calculate the elapsed time in months, we can use the formula =(NOW()-A1)/30. This returns
the value in 30 day months.

I use to apply formula =ROUND((TODAY()-A1)/30,0). Today, I faced a peculiar situation, A1 has


date 01-Mar-2009, and today being 01-Mar-2012, it should be 36 months, but it is showing 37
months!!

Any suggestions to avoid such errors?

Regards,

12 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

Reply

Hui says:
April 15, 2012 at 1:24 am

@Pete
I use Excel 2010 and it still works

The times must be entered as times in the format hh:mm:ss or hh:mm without seconds
Adding up times is as simple as =Sum(Range) or =Sum(A2:A10)
then using a Custom Number format as you have mentioned [h]:mm

If this isn't working, 2 ideas


1. Check your times are times and not text
2. Can you share your data or file with us?

Reply

15. Kent in Wichita says:


July 13, 2012 at 6:19 pm

My hospital tracks times from patient arrival to various procedures or treatments. When those
times cross over midnight, the regular formulas (2nd time minus first time) don’t work because
the result is negative and Excel (2007) won’t show a negative number in time format.
I couldn’t find a solution here (chandoo.org) but found one elsewhere that worked and it’s very
simple. I would like to share it.
Assuming 1st time in A1 (column for patient arrival time) (11:00 PM), and 2nd time in B1
(column for x-ray given) (12:30 AM)). Should be 1:30 elapsed time.
=B1-A1+(B1<A1) [This comparison is the key to the solution.]
=12:30 AM – 11:00 PM + (12:30 AM < 11:00 PM)
=0.0208 – 0.9583 + (True)
=-0.9375 + (1) [This is the key! If it is false, Excel adds 0. If it’s true, Excel adds 1 and that is
what corrects the negative number. Now Excel can interpret the number as a time.]
=0.0625
Converted to hh:mm = 1:30
I wrapped this formula inside an IFERROR one to alert my data entry person if she messed up

13 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

Reply

16. shashidhar says:


December 9, 2012 at 1:57 pm

HI,

I am working on a Xl application..
I want to capture time between two clicks.
Ex, in my application during run somewhere I press OK button and then I click Cancel.. I want to
measure time between these two clicks... Is it possible??
Pls help on this...

Reply

Hui says:
December 10, 2012 at 1:31 am

@shashidhar
The answer is Yes
You will have to add an appropriate VBA event to start and stop a timer.
There are techniques which can time to the millisecond so maybe look those up on the net

Reply

17. William W. says:


October 30, 2013 at 5:16 am

WOW!!!!!! I truly love your excel time format program! WHOOOO! I am very interested in how
the time formats "update" (manually on a physical keyboard) that "updates" the time into its
respective decimal time formats, such as:
YYYY.yyyy, HH.hhh, etc...

How do those formulas or equations work if not in Excel mode? Example: TI calculators, Word, or

14 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

December 24, 2013 at 1:48 pm

Regarding the elapsed time in months:


I made this function to determine the time elapsed since a date using the number of days in each
respective month. It's a simple subtraction and I think it works very well:((Year Today-Year
A1)*12++(Month Today - Month A1)+(Day Today/Days in Month Today)-Days A1/Days in month
A1)

Here's the function:


=((YEAR(TODAY())-YEAR(A1))*12)+(MONTH(TODAY())-MONTH(A1))+
(DAY(TODAY())/DAY(DATE(YEAR(TODAY()),MONTH(TODAY())+1,0))-DAY(A1)
/DAY(DATE(YEAR(A1),MONTH(A1)+1,0)))

Have a Merry Christmas everyone!!

Reply

19. Christian says:


January 25, 2015 at 1:19 am

I need the ability to calculate how much progress we have made between two dates and I want
to represent that as a percentage.

I am thinking this would be a combination of today, networkdays & dividing the days elapsed vs
the total days. Then it should be as easy as formatting my cell. Any help would be greatly
appreciated.

Reply

Hui... says:
January 25, 2015 at 8:12 am

@Christian
Your correct
dates are just numbers and so you can use simple math to derive the percentage
=(Date Now-Start Date)/(End date-Start date)
that will give you a number between 0 and 1
which you can format as a %'age

15 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

I want to calculate the timelapse taking into consideration the day begin and dayend time.

If the work begins and ends the same day, a simple formula b1-a1 would compute the
productivity.

But if the process remains incomplete and is carried over to the next day, then timelines to be
computed accordingly

to clarify,
if start time of an activity is 03/15/2015 18:00 hrs and end time is 03/16/2015 11:00 hrs, then
the resultant formula should be 5 hrs (ie 18:00 to 20:00 hrs on day1 + 08:00 to 11:00 hrs on
day2) ie 2+3

please guide.

Reply

Kent in Wichita says:


March 18, 2015 at 3:12 pm

Venkatesh, try (b1-a1)-0.5

This will subtract the fixed amount of time between shifts, 12 hours. If the time between
shifts varies, then you could reference other cells that contain the variables.

Reply

21. aria says:


March 25, 2015 at 12:56 pm

Please help. when I use the networking days formula I get a date (2-may-00) I want actual
number of days. I managing projects and I need to know how many days have passed since we
received a project to the current date. Please help Thanks

Reply

Chandoo says:

16 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

Reply

23. modeste says:


June 1, 2015 at 8:28 am

Hi folks ...
calculating age in years , months and days
=text(now()-a1,"yy")&" y " &text(now()-a1,"mm")-1 &" m "&text(now()-a1,"dd") & " d"

Reply

24. Dan S says:


June 2, 2015 at 9:11 pm

Hi, the Elapsed time in days [ =TODAY()-A1 ] works great however, if I do not have a date in A1,
it shows 42157. Anyway to get it to display 0 or a Null value?

Reply

Hui... says:
June 3, 2015 at 1:11 am

@Dan
=If(A1="",0,TODAY()-A1)

Reply

Dan S says:
June 8, 2015 at 5:45 pm

I get #NAME? and the formula does not work.

Reply

25. Veena says:


November 13, 2015 at 9:37 pm

17 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

4) Work week is Mon through Friday.

Can you help?

Thanks!

Reply

26. zaidan says:


March 16, 2017 at 10:47 am

Hi, i have a certain name (wilium) in column A and against this name i have 2 option, 1 Done
and 2 Inprogress. i want that i count done again wilium and count inprogress against wilium
separately. which formula will work for it??

Reply

27. zaidan says:


March 16, 2017 at 10:48 am

Hi, i have a certain name (wilium) in column A and against this name i have 2 option, 1 Done
and 2 Inprogress in column C. i want that i count done again wilium and count inprogress against
wilium separately. which formula will work for it??

Reply

28. Augustine Boltz says:


March 20, 2018 at 1:50 am

Year, month, day results for DoB.


The formulas I have found on the net and the datedif function do not work. This is what I came
up with using a Microsoft support paper dated April 1997 with some modifications:
IF(OR(A2>$A$1,ISBLANK(A2)),"",IF(YEAR($A$1)=YEAR(A2),0,IF(MONTH($A$1)>=MONTH(A2),YEAR($A$1)-
YEAR(A2),YEAR($A$1)-YEAR(A2)-1))&" years "&MONTH($A$1)-
MONTH(A2)+IF(AND(MONTH($A$1)<=MONTH(A2),DAY($A$1)
<DAY(A2)),11,IF(AND(MONTH($A$1)=DAY(A2)),12,IF(AND(MONTH($A$1)>MONTH(A2),DAY($A$1)=DAY(A2),ABS(DAY($A$1)-
DAY(A2)),DAY(EOMONTH(A2,0))-DAY(A2)+DAY($A$1))&" days")

18 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

calculating age in years , months and days


=YEAR(NOW()-DoB)-1900 & " y " & MONTH(NOW()-DoB)-1 & " m " & DAY(NOW()-DoB) &
" d"

Reply

29. Jenna says:


July 29, 2018 at 11:02 am

Hi Chandoo,

I am looking for help with the elapse time formula. I have a recruitment tracking sheet where we
track the number of days the positions are opened, and when they are finally closed.

The opened positions will have a running turnaround time (TAT) formula and I am using this
formula:
=NETWORKDAYS (start_date, TODAY (), Holidays2018)

Now, without disrupting the running TAT formula, how do I then get the TAT to stop when we
have a final end date? All the information below is row:
- start_date --> Cell A
- TODAY () --> cell B
- end_date --> Cell C

Hope you are able to help. Thanks!

Reply

Chandoo says:
July 29, 2018 at 10:08 pm

Interesting question. Try this:

=NETWORKDAYS (start_date, if(end_date <>"", end_date, TODAY ()), Holidays2018)

Reply

30. Athena says:

19 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

20 of 21 23/3/21, 12:40 am
How to Calculate Elapsed Time using Excel Formulas? https://chandoo.org/wp/elapsed-time-excel/

goodness. Join 100,000+ others and get it free.

Yes, sign me up $

GET STARTED ONLINE CLASSES ABOUT DOWNLOADS

Excel Basics Excel School My Story 20+ Excel Templates

Advanced Excel VBA Classes Welcome Message 200+ Dashboards

100+ Formulas Power BI Classes Contact 40+ VBA Code samples

Free Crash Course 50 ways to analyze data Forum & Community Ebooks & More

Pivot Tables

Power BI

" $ % &
© All rights reserved.

21 of 21 23/3/21, 12:40 am

You might also like