Can someone help me build an excel template query?

ASeal 0 Reputation points
2025-08-12T03:49:40.39+00:00

Hi. I need help making a schedule template in excel based off a template from Shifts for Teams. I made a post before here: https://answers.microsoft.com/en-us/msoffice/forum/all/can-i-duplicate-spreadsheets-with-formulas/dc6b0209-f04a-40ee-830a-96b6829853d5. Volunteer Andreas Killer built the template before, and I need help again. Can someone help? Basically, I need the same thing, except the query needs to read the time input as [8:00 am - 4:30 pm] instead of [8:00]. And there a no unpaid breaks on Sundays.

Microsoft 365 and Office | Excel | For business | MacOS
{count} votes

1 answer

Sort by: Most helpful
  1. Flora-T 7,855 Reputation points Microsoft External Staff Moderator
    2025-08-12T07:33:09.4+00:00

    Dear ASeal

    Welcome to Microsoft Q&A Forum. Thank you for reaching out and posting your question.

    Based on the 'macOS' tag included in your post, I have created and tested the following steps on Excel for Mac to ensure it meets your requirements:

    Step 1: Setting up your data as an Excel Table is the key to making this template automatic, as it will copy formulas down for new entries

    • In a new sheet, set up your headers in the first row: NameDate, and Shift
    • Enter a few rows of sample data to test with, including a weekday, a Sunday, and a day that is "Off" or blank.
    • Select your entire data range, including the headers. 
    • press Cmd + T to format it as a Table > Tick the "My table has headers" checkbox > Click OK

    Step 2: You need to add the three calculation columns, and enter formulas in the first data cell of each column

    *Column 1: Total Hours will calculate the shift duration and return 0 if the cell is blank or contains non-time text like "Off". *

    • Formula:
    =IFERROR(LET( start_time, TIMEVALUE(TRIM(TEXTBEFORE([@Shift]," - "))), end_time, TIMEVALUE(TRIM(TEXTAFTER([@Shift]," - "))), duration, (end_time - start_time + (end_time < start_time)) * 24, duration ), 0)
    

     Column 2: Unpaid Break will correctly apply the 0.5-hour break only when hours have been worked and the day is not a Sunday. 

    • Formula:
    =IF(AND([@[Total Hours]]>0, WEEKDAY([@Date], 1)<>1), 0.5, 0)
    

    Column 3: Payable Hours will subtract the break from the total hours to get the final payable amount. 

    • Formula:
    =[@[Total Hours]]-[@[Unpaid Break]]
    

    Your template is now complete and will automatically calculate all hours correctly based on your input. The final result is shown in this image:User's image

    Additionally, to add a new entry, simply start typing in the row directly below the last line of your table. The table will expand, and all the formulas will be automatically filled in for you.  If you only want to display the final Payable Hours, you can right-click on the Total Hours and Unpaid Break columns and select Hide from the context menu.

    I hope this step by step guide will help with your template. If you need the template file with my suggestions, please feel free to contact me via private message.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".User's imageNote: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.