We help IT Professionals succeed at work.

Calcule Uptime in days and minutes excel

149 Views
Last Modified: 2017-03-30
Good Morning

I would like to calculate the uptime of a server.

I have a column with the last date and time the server was restarted.

I have another column of "uptime days minutes" and I want this column to show the time in days and minutes that the server is active.

I tried the formula below but it did not work

= B2-now ()

       A                                                B                                                                          C
Server Name                             Last_Restart                                                   Uptime days minutes
Server02                  2017-02-25 15:00:04.253                                        = B2-now ()
Server03                  2017-01-08 05:47:40.570      
Server04                  2017-02-14 05:40:58.500      
Server01                  2017-01-10 05:49:52.830      
Server05                  2017-01-08 09:02:33.167      
Server06                  2017-03-29 09:05:56.940      
Server07                  2017-02-25 15:14:06.887      
Server08                  2017-01-13 00:35:18.460      
Server09                  2017-01-15 07:20:50.007      
Server10                  2017-03-02 04:39:08.227      
Server11                  2017-01-31 03:25:42.250      
Server12                  2017-02-20 10:00:52.463      

Can anybody help me
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016

Commented:
Hi,

Change the format to [mm]
or
=TEXT(NOW()-B2,"[mm]")

Open in new window

Regards
CERTIFIED EXPERT
Top Expert 2016

Commented:
HI,

pls try
=INT(NOW()-B2)&" day(s) "&TEXT((NOW()-B2)-INT(NOW()-B2);"[mm]")&" Minute(s)"

Open in new window

Regards
ShumsManaging Director/Excel VBA Developer
CERTIFIED EXPERT
Distinguished Expert 2018

Commented:
Try below:
=IF(TEXT(TODAY(),"d")-TEXT($B1,"d")>1,DAY(TODAY()-$B1)&" Days "&HOUR(NOW()-$B1)&" Hours "& MINUTE(NOW()-$B1)&" Minutes ",HOUR(NOW()-$B1)&" Hours "& MINUTE(NOW()-$B1)&" Minutes ")

Open in new window

Server-Timings.JPG

Author

Commented:
Hello,

For me it is giving error, I think I am doing something wrong.

You can put it in the worksheet that is attached.

Thank you.
Plan1.xlsx
ShumsManaging Director/Excel VBA Developer
CERTIFIED EXPERT
Distinguished Expert 2018

Commented:
Please find attached...
Alex_Plan1.xlsx
Finance Analyst
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
ShumsManaging Director/Excel VBA Developer
CERTIFIED EXPERT
Distinguished Expert 2018

Commented:
Corrected formula:
=IF(TEXT(TODAY(),"d")-TEXT($B2,"d")>1,DAY(TODAY()-DAY($B2))&" Days "&HOUR(NOW()-HOUR($B2))&" Hours "& MINUTE(NOW()-MINUTE($B2))&" Minutes ",HOUR(NOW()-HOUR($B2))&" Hours "& MINUTE(NOW()-MINUTE($B2))&" Minutes ")

Open in new window

Alex_Plan1.xlsx
Rob HensonFinance Analyst
CERTIFIED EXPERT

Commented:
Try this:

=INT(TEXT(NOW()-B2,"[m]")/1440)&" Days "&TEXT(TIME(INT(MOD(TEXT(NOW()-B2,"[m]"),1440)/60),TEXT(NOW()-B2,"[m]")-(INT(TEXT(NOW()-B2,"[m]")/1440)*1440)-(INT(MOD(TEXT(NOW()-B2,"[m]"),1440)/60)*60),0),"hh:mm")

Format can be General as the result is a text string.

Using RGonzo's formula to get total number of minutes then converts that value into Days Hours and Minutes.

See Attached.

Thanks
Rob H
Server-time.xlsx
Rob HensonFinance Analyst
CERTIFIED EXPERT

Commented:
Alex, thanks for accepting my comment but unfortunately the file that is attached to that comment had the wrong formula; the day element was incorrect.

Author

Commented:
It is true,

I did not notice the detail of the day

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions