What's new

Help Duration formula

Trident_muh

Eternal Poster
Established
Duration formula

I'm using google spreedsheet, I have here 3 column's. Column A row 1 header title is "time start". Column B row 1 header title "time end" and Column C row 1 "duration. Column C time format is "dd:hh:mm:ss"

can provide formula to use in Column C to compute the duration of Column A and B. but only if there is value in column B if there is none Column C will compute Column A and todays current time.
 
Solution
To calculate the duration between the time in Column A and Column B, taking into account the condition you mentioned, you can use the following formula in Column C:

=IF(B1<>"", B1-A1, NOW()-A1)

Here's how the formula works:

- IF(B1<>"": This checks if there is a value in Column B. If there is a value, it means there is an end time, so the formula will calculate the difference between the end time (B1) and the start time (A1).

- B1-A1: This calculates the duration between the start time and end time in Column B and A, respectively.

- NOW()-A1: If there is no value in Column B, the formula will calculate the duration between the start time (A1) and the current time using the NOW() function.

Make sure to format the cells in Column C...
To calculate the duration between the time in Column A and Column B, taking into account the condition you mentioned, you can use the following formula in Column C:

=IF(B1<>"", B1-A1, NOW()-A1)

Here's how the formula works:

- IF(B1<>"": This checks if there is a value in Column B. If there is a value, it means there is an end time, so the formula will calculate the difference between the end time (B1) and the start time (A1).

- B1-A1: This calculates the duration between the start time and end time in Column B and A, respectively.

- NOW()-A1: If there is no value in Column B, the formula will calculate the duration between the start time (A1) and the current time using the NOW() function.

Make sure to format the cells in Column C as "dd:hh:mm:ss" to display the duration correctly.
 
Solution
To calculate the duration between the time in Column A and Column B, taking into account the condition you mentioned, you can use the following formula in Column C:

=IF(B1<>"", B1-A1, NOW()-A1)

Here's how the formula works:

- IF(B1<>"": This checks if there is a value in Column B. If there is a value, it means there is an end time, so the formula will calculate the difference between the end time (B1) and the start time (A1).

- B1-A1: This calculates the duration between the start time and end time in Column B and A, respectively.

- NOW()-A1: If there is no value in Column B, the formula will calculate the duration between the start time (A1) and the current time using the NOW() function.

Make sure to format the cells in Column C as "dd:hh:mm:ss" to display the duration correctly.
Thank you..
 

Similar threads

Back
Top