LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Open Office Calc Formula to Computer Time Duration (https://www.linuxquestions.org/questions/linux-newbie-8/open-office-calc-formula-to-computer-time-duration-4175413373/)

tailinlinux 06-25-2012 10:42 PM

Open Office Calc Formula to Computer Time Duration
 
Do anyone here knows, formula to compute time duration in calc?
Example:
Time Started Time Finished Duration
08:00AM 09:00 AM = 1 Hour or 1

Thanks in advance.

Snark1994 06-26-2012 07:49 AM

Working with A1, B1, C1:
  • Select A1 and B1 and go Format > Cells and change 'Category' to 'Time' and 'Format' to '01:37 PM'.
  • Select C1 and go Format > Cells and change 'Category' to 'Time' and 'Format' to '01:37'.
  • Edit A1 to contain the start time, then edit B1 to contain the end time (both in HH:MM:SS format).
  • Finally, enter '=B1-A1' in C1 and it will display the difference in times correctly.

Hope this helps,

tailinlinux 06-26-2012 08:09 PM

Quote:

Originally Posted by Snark1994 (Post 4712417)
Working with A1, B1, C1:
  • Select A1 and B1 and go Format > Cells and change 'Category' to 'Time' and 'Format' to '01:37 PM'.
  • Select C1 and go Format > Cells and change 'Category' to 'Time' and 'Format' to '01:37'.
  • Edit A1 to contain the start time, then edit B1 to contain the end time (both in HH:MM:SS format).
  • Finally, enter '=B1-A1' in C1 and it will display the difference in times correctly.

Hope this helps,

Thanks for reply but this is not working.
I want to know if i can make a formula to computer time duration.
Example:
Time Started A1= 10:00:00 AM
Time End B1= 10:30:00 AM
Duration C1= 30 Mins.

tailinlinux 06-27-2012 02:59 AM

Yeah i already did it.
Thanks for the reply.

This is the formula Ive done.
Code:

=B1-A1+IF(A1>B1,1)

Snark1994 06-27-2012 10:37 AM

Well... The formula I gave should work with your test data (10:00:00 and 10:30:00). Your formula will show the (positive) difference of the two if the start time is after the end time, which is an unlikely occurrence for well-behaved data - however, I don't know the context of your spreadsheet.

If you consider your problem to be solved, please mark the thread as 'SOLVED'. Thanks :)

suicidaleggroll 06-27-2012 11:05 AM

Quote:

Originally Posted by Snark1994 (Post 4713380)
Your formula will show the (positive) difference of the two if the start time is after the end time, which is an unlikely occurrence for well-behaved data - however, I don't know the context of your spreadsheet.

It looks like his mod is to add a day in case the start/end crosses the 24hr border.

tailinlinux 06-28-2012 01:30 AM

Thanks for all the reply. I am already satisfied on my formula, and i already use it by now.

More powers to LQ.

Snark1994 06-28-2012 02:47 AM

Quote:

Originally Posted by suicidaleggroll (Post 4713402)
It looks like his mod is to add a day in case the start/end crosses the 24hr border.

*facepalm* duhhhh. Sometimes I should remember to switch my brain on. Yeah, that's a more plausible usecase than a start time after your end time...


All times are GMT -5. The time now is 08:52 AM.