Solved

# How to calculate when system is down between datestamp

Posted on 2011-09-14
411 Views
Hi,
i want to calculate when duration is zero based on the datestamp and would like to group it by Date and Hour.  Pls. see attached sample for the desired results.  thanks
sample.xlsx
0
Question by:karinos57
• 3
• 3

LVL 50

Accepted Solution

Ingeborg Hawighorst earned 500 total points
ID: 36540706
Hello,

=IF(C2=0,MINUTE(A1-A2),0)

copy down. Now you can build a pivot table with the date stamp in the row headers, grouped by day and hour.

See attached, on Sheet2

cheers, teylyn

sample--2-.xlsx
0

LVL 50

Expert Comment

ID: 36540726
Or, for better precision, use this as the formula:

=IF(C2=0,1440*(A1-A2),0)

cheers,
0

Author Comment

ID: 36543019
teylyn:
this is working great but one quesiton for you, where did you get the Days field in the pivot?  i don't see it in the data source.  I only see DateStamp.  thanks
0

Author Comment

ID: 36543222
i like the way you formatted like the DateStamp by just showing hours and grouped by a day  but it is not clear.  Can you post antother sheet where i can see all the formatting or if you can explain - i will appreciate that. thanks
0

Author Closing Comment

ID: 36544590
thnx
0

LVL 50

Expert Comment

ID: 36545596
Hello,

I used Excel 2010 to create the pivot table. Right-click on any date in the pivot table and select Group - then tick the day and hour.

After that, I used the buttons on the pivot table layout tab to play with the appearance of the table. Some of these options are new to 2010,  but I don't think I used any of the new ones.

cheers, teylyn
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…