Avatar of Support_38
Support_38
 asked on

Calcule Uptime in days and minutes excel

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
Microsoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Support_38

8/22/2022 - Mon
Rgonzo1971

Hi,

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

Open in new window

Regards
Rgonzo1971

HI,

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

Open in new window

Regards
Shums Faruk

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
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Support_38

ASKER
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
Shums Faruk

Please find attached...
Alex_Plan1.xlsx
ASKER CERTIFIED SOLUTION
Rob Henson

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Shums Faruk

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
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Rob Henson

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 Henson

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.
Support_38

ASKER
It is true,

I did not notice the detail of the day
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes