Question:

Please help me in Excel. Which formula should I enter?

by  |  earlier

0 LIKES UnLike

I need a formula that automatically computes the TOTAL number of hours by entering the arrival and departure time.

For example.

Cell A1 (7am) arrival time

Cell B1 (3:15pm) departure time

Total number of hours: 8.25

 Tags:

   Report

1 ANSWERS


  1. Time Intervals

    You can determine the number of hours and minutes between two times by subtracting the two times.  However, since Excel cannot handle negative times, you must use an =IF statement to adjust the time accordingly.  If your times were entered without a date (e.g, 22:30), the following statement will compute the interval between two times in A1 and B1 .

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

    The "+1" in the formula causes Excel to treat B1  as if it were in the next day, so 02:30-22:00 will result in 4:30, four hours and thirty minutes, which is what we would expect.  To covert this to a decimal number, for example, 4.5, indicating how many hours, multiply the result by 24 and format the cell as General or Decimal, as in

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

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions