+ Reply to Thread
Results 1 to 4 of 4

Counting a travel day as half if travel starts before specific time

  1. #1
    Registered User
    Join Date
    10-30-2018
    Location
    Gothenburg, Sweden
    MS-Off Ver
    2016
    Posts
    2

    Question Counting a travel day as half if travel starts before specific time

    Hi!

    I'm making a spreadsheet to calculate per diems for my staff.
    Swedish tax laws state that a travel day counts as half if the trip starts after 12.00 (noon), and/or ends before 19.00 (7pm)

    I'm looking for a formula where I can use two cells with the "date and time" format (one cell for start date/time and one cell for end date/time) and automatically calculate half days and whole days.

    If this is possible in the way I described, or any other way, I'm very grateful for tips!

    All the best,

    Åke Andersson
    Ankarhult Group

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Counting a travel day as half if travel starts before specific time

    Perhaps, assuming start date in A2 and end date in B2.

    =IF(OR(HOUR(A2)>12, HOUR(B2)<19), "Half", "Whole")
    If posting code please use code tags, see here.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Counting a travel day as half if travel starts before specific time

    IF(OR(TEXT(A1,"hh:mm")>"12:00",TEXT(B1,"hh:mm")<"19:00"),0.5,1)

    where A1 is start time and B1 is end time
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Registered User
    Join Date
    10-30-2018
    Location
    Gothenburg, Sweden
    MS-Off Ver
    2016
    Posts
    2

    Re: Counting a travel day as half if travel starts before specific time

    Great, that's what I was looking for

    All the best,

    Åke

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Adding Travel Time Calculations to Outlook
    By RoyLittle0 in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 01-02-2015, 03:48 PM
  2. Replies: 2
    Last Post: 07-16-2014, 12:37 PM
  3. Estimated Travel Time
    By ctexcelguy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-13-2013, 01:03 AM
  4. Calculating travel time for set destinations
    By ashcrroft752 in forum Excel General
    Replies: 4
    Last Post: 06-14-2012, 08:06 PM
  5. Function to get travel time from mapquest
    By sunnyk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2010, 10:05 PM
  6. Time Travel & Upon Opening WB Macros
    By gandolff in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2009, 11:47 AM
  7. travel time distance formula
    By kapanenship in forum Excel General
    Replies: 2
    Last Post: 05-20-2008, 12:35 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1