We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide

Excel Help Please - Time Difference Calculation

Hi,

I have a works spreadsheet given to me which for example has time worked in cell A1 - 06:00-15:00

In cell B2 I have to put in manually the difference in hours to show actual time worked.

I have said having a start/finish/worked format would work to enable automatic calculation of the time difference but I have been told I cannot alter in any way the layout but am welcome to put formulas into cells if it helps!!!.....go figure!

Is there anyway in excel to show the difference in a work pattern shift when all the data is only in one cell in a time format as above?

Thanks

Comments

  • Stompa
    Stompa Posts: 8,390 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    You could use something like:

    =TIMEVALUE(RIGHT(A1,5))-TIMEVALUE(LEFT(A1,5))

    though it'll only work as it stands if they've stuck rigidly to the format 'hh:mm-hh:mm' (i.e. no spurious spaces or whatever). It'll also fail if the second time is less than the first (e.g. 20:00-02:00). It could of course be tweaked to cover those possibilities if need be.
    Stompa
  • Mattjimf
    Mattjimf Posts: 556 Forumite
    Part of the Furniture Combo Breaker
    edited 6 February 2010 at 10:55AM
    I really don't think there is a way to do what your wanting. I stand corrected.
    Why not just copy the spreadsheet (saving it with a different name), make it the way you want it, then copy the row/column onto the original spreadsheet.
    Sometimes i surprise myself by being right.
  • Stompa
    Stompa Posts: 8,390 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    edited 6 February 2010 at 11:10AM
    Thinking about it, the spurious spaces issue would be easily solved by using:

    =TIMEVALUE(RIGHT(TRIM(A1),5))-TIMEVALUE(LEFT(TRIM(A1),5))

    and the start and end times being on different days by using:

    =MOD(TIMEVALUE(RIGHT(TRIM(A1),5))-TIMEVALUE(LEFT(TRIM(A1),5))+1,1)
    Stompa
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 353.5K Banking & Borrowing
  • 254.1K Reduce Debt & Boost Income
  • 455K Spending & Discounts
  • 246.6K Work, Benefits & Business
  • 602.9K Mortgages, Homes & Bills
  • 178.1K Life & Family
  • 260.6K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.