+ Reply to Thread
Results 1 to 12 of 12

Calculate time greater than allowance

  1. #1
    Registered User
    Join Date
    12-02-2019
    Location
    Sydney, Australia
    MS-Off Ver
    2016 i think
    Posts
    15

    Calculate time greater than allowance

    I need to be able to calculate the 'overstay' in minutes greater than the below numbers depending on the 'suburb'. If the time is less than the below, for the cell to remain blank.

    I can not work out how to get the answer i require using multiple suburbs, with different times.

    North Rocks > 45mins
    Ingleburn > 30mins
    Minto > 30mins
    Any other suburb = blank
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,052

    Re: Calculate time greater than allowance

    One way in D3 and copy down.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-02-2019
    Location
    Sydney, Australia
    MS-Off Ver
    2016 i think
    Posts
    15

    Re: Calculate time greater than allowance

    Thankyou. However, when i use this, if the mins are less than, its calculating it as a minus. If it is less than, cell needs to remain blank.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2021
    Posts
    5,975

    Re: Calculate time greater than allowance

    Try this in D3:

    =IFERROR(LOOKUP(2,1/(A3={"North Rocks";"Ingleburn";"Minto"})/((C3-B3)*1440>{15;30;45}),{15;30;45}),"")

  5. #5
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,052

    Re: Calculate time greater than allowance

    Amended formula,

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-02-2019
    Location
    Sydney, Australia
    MS-Off Ver
    2016 i think
    Posts
    15

    Re: Calculate time greater than allowance

    Afternoon, thankyou, this has worked. When putting this through to my spreadsheet, i have some times that are moving across to the next day...i.e shift work, 11:30pm - 1:25am. This goes through to weekends as well, so, i can't think how "WORKDAY" would work.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,464

    Re: Calculate time greater than allowance

    Maybe provide a more realistic set of sample data that shows the issues with the formula as it stands? Make sure that ALL eventualities are covered.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Registered User
    Join Date
    12-02-2019
    Location
    Sydney, Australia
    MS-Off Ver
    2016 i think
    Posts
    15

    Re: Calculate time greater than allowance

    I have attached an updated sheet. I had forgotten about the 'overnight' hours until i was entering the data in, and using the formula that i had been given.

    I am unsure how to calculate the hours that are 'overnight', or 'next day'. Times are formatting in the 24hr time.

    North Rocks > 45mins
    Ingleburn > 30mins
    Minto > 30mins
    Any other suburb = blank
    Attached Files Attached Files

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,464

    Re: Calculate time greater than allowance

    Why should D9 be 150 mins and not 180?

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,464

    Re: Calculate time greater than allowance

    Is this it?

    In E3 copied down:

    =IFERROR(IF(B3>C3,1-(B3-C3),C3-B3)*1440-LOOKUP(2,1/(A3={"North Rocks";"Ingleburn";"Minto"})/((IF(B3>C3,1-(B3-C3),C3-B3))*1440>{45;30;30}),{45;30;30}),"")

    Please CHECK which version of Excel you have and update your profile accordingly - "I think" is not precise enough!

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,464

    Re: Calculate time greater than allowance

    Or this:

    =IFERROR(TEXT(IF(B3>C3,1-(B3-C3),C3-B3)*1440-LOOKUP(2,1/(A3={"North Rocks";"Ingleburn";"Minto"})/((IF(B3>C3,1-(B3-C3),C3-B3))*1440>{45;30;30}),{45;30;30}),"0")&"mins","")

  12. #12
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,129

    Re: Calculate time greater than allowance

    Alternatively,
    =IFERROR(TEXT(1/(1/MAX(MOD(C3-B3,1)*24*60-INDEX({30,30,45},MATCH(A3,{"Ingleburn","Minto","North Rocks"},0)),0)),"0 \mi\n\s"),"")

+ 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. [SOLVED] Excel formula to calculate special initial tax allowance
    By sunboy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2022, 01:24 PM
  2. Calculate remaining balance on allowance
    By finarino in forum Excel General
    Replies: 1
    Last Post: 06-15-2021, 10:01 PM
  3. Formula to calculate total sum that has a factored allowance
    By seftonbarn in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-15-2015, 09:20 AM
  4. Need to calculate shift allowance in a costings roster
    By Patricia999 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-20-2015, 01:02 AM
  5. Calculate Vacation Allowance based on years of service
    By Sassygirl44 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-29-2015, 03:47 PM
  6. Uniform Allowance - Formula for Totals in Excess of Allowance
    By kgreene82 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-15-2012, 05:31 PM
  7. How to calculate shift allowance
    By [email protected] in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-30-2010, 04:50 AM

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