Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ Excel General
In a line graph I plot certain values against time programatically(Macro)for a survey.
 
The number of hours in a survey are not same always. In order to divide the x-axis (time) in equal intervals,
 
Eg: The time is starts from 00:00:00 to 19:00:00.
     TotalTime = FinalTime - InitialTime
     TotalTime =  19:00:00 - 00:00:00
     TotalTime = 19:00:00 
But in a new data set I got, the survey runs for 2 / 3 days continuously.
So now to check the total number of hours, when the final and initial values are subtracted, the resulting value is only few hours.
 
ex:
Start Time = 01:00:00(Day1), End Time = 07:00:00(Day2)
The result is 06:00:00 
but this is incorrect
 
Need some suggestions please
Posted 25-Sep-12 3:09am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Why don't you consider the date or days elapsed. You can use the formula
 
(FinalTime - InitialTime) + (DayDiff * 24)
 

e.g. 01:00:00 (day1) and 07:00:00 (day2), then
6 + 24 = 30 hrs.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 509
1 Nirav Prabtani 298
2 OriginalGriff 215
3 _Amy 165
4 Abhinav S 160
0 OriginalGriff 7,715
1 Sergey Alexandrovich Kryukov 6,911
2 Maciej Los 3,954
3 Peter Leow 3,698
4 CHill60 2,742


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 25 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100