Dashboard

How to Choose Opening Hours With AI

Choose opening hours with AI using your own till data, not guesswork. A contribution margin per hour method that shows which hours actually pay.

Steve Jefferson
Steve Jefferson
Developer Advocate
9 October 20261 min read

Ask a model what hours your shop should open and it will hand you something plausible and useless, because it is guessing from the general case. To choose opening hours with AI properly you give it your own numbers and make it do arithmetic you could check by hand. The interesting output is not a schedule, it is which hours are losing you money.

The whole exercise takes about an hour and needs three things you already have.

The three inputs

Transactions by hour, at least eight weeks. Every till and booking system exports this. You want timestamp and total, nothing else. Eight weeks is the minimum that survives one odd week.

What an open hour costs you. Staff on shift including employer costs, plus the marginal utilities and anything hourly. Not rent. Rent is paid whether you open or not, so including it makes every quiet hour look fatal and tells you nothing about the decision in front of you.

Your gross margin. Revenue minus cost of goods, as a percentage. A cafe pulling 70 percent and a bike shop pulling 35 percent get opposite answers from identical takings.

Strip names and card details before any of this goes near a model. You are sending an hourly summary, not a customer list.

How to choose opening hours with a contribution calculation

For each hour the business is open:

Contribution = (average revenue in that hour x gross margin) - staff cost for that hour

Positive means the hour pays for itself and something towards the rent. Negative means you are paying to be open.

A worked example for a cafe, 42 percent gross margin, one staff member at 22 per hour fully loaded, two at peak:

Hour

Avg revenue

Gross profit

Staff cost

Contribution

07:00

38

15.96

22

-6.04

08:00

96

40.32

22

18.32

09:00

142

59.64

44

15.64

12:00

210

88.20

44

44.20

15:00

61

25.62

22

3.62

16:00

44

18.48

22

-3.52

17:00

29

12.18

22

-9.82

The seven o'clock hour takes money and loses it. So does everything after four. Closing at 16:00 and opening at 08:00 adds roughly 15.86 a day, about 4,100 a year on a six-day week, without serving one fewer customer at the hours that matter.

That is the number a model is genuinely useful for producing, from your data, quickly, across every hour and every weekday, which is the part that is tedious by hand.

The prompt

Give it the table and the constraints, and ask for the working:

> Here is hourly transaction data for a cafe, eight weeks, columns: date, hour, number of transactions, total revenue. Gross margin is 42 percent. Staff cost is 22 per hour with one person, 44 with two, and I need two people whenever hourly revenue exceeds 120. > > For each weekday and hour, calculate average revenue, gross profit, staff cost and contribution. Show the full table. Then list every weekday and hour combination with negative contribution, and tell me what closing those hours would save per week. Show your arithmetic for two rows so I can check it.

Asking it to show the arithmetic for two rows is not politeness. Models still slip on repetitive multiplication across a long table, and checking two rows against a calculator catches it in thirty seconds. Checking AI maths before you trust it is the same discipline applied to a different ledger.

What the numbers will not tell you

Three adjustments the arithmetic cannot make, and you have to.

The first hour feeds the second. Commuters who buy at 07:15 sometimes come back at lunch. If closing the early hour costs you the midday regular, the saving is smaller than the table says. You can test this: close the hour for three weeks and watch whether the later hours move.

Being reliably open has value. A shop with hours that change by season teaches people to check before travelling, and some of them stop travelling. Cutting one hour is cheap. Cutting a different hour each quarter is expensive in a way that never appears in a contribution calculation.

Staff do not come in hourly units. Dropping a loss-making hour at the end of a shift is real money. Dropping one in the middle is not, because you still pay the person either side of it.

Feed those back in as constraints and re-run. A model will happily recommend closing 14:00 to 15:00 on a Tuesday, which is arithmetically correct and operationally absurd.

Make it a habit, not a project

Re-run it quarterly. Hours that paid in November may not pay in February, and the exercise is now a prompt and a CSV rather than an afternoon.

The same hourly data supports the related questions: planning stock for a busy week uses the same peaks to decide what to hold, and planning a seasonal promotion uses the quiet hours as the thing a promotion is trying to fill. If the quiet hours are mostly people asking questions rather than buying, handling after-hours customer questions with AI may be the cheaper answer than staying open. For the wider picture of which of these efforts actually pay back, see measuring AI ROI for a small business.

Once you change your hours, update them where customers look. Google reviews profile edits before publishing them, and pending changes can take anywhere from ten minutes to thirty days according to Google's Business Profile documentation, so make the change before the week it takes effect, not after.

FAQ

How much transaction data do I need before this is meaningful?

Eight weeks is a workable minimum, twelve is better. Less than that and a single bad weather week or a local event will drive the answer.

Should I include rent in the hourly cost?

No. Rent is paid whether you open or not, so it does not change the decision about any individual hour. Include only costs that disappear when the door is shut.

What if an hour is break-even?

Keep it, provisionally. Break-even hours carry the reliability value described above, and they are the first to improve if trade picks up. Cut the clearly negative ones first and look again next quarter.

Can I do this for a service business with bookings instead of a till?

Yes, and it is usually cleaner. Bookings give you the hour, the value and the staff member in one record, so the contribution calculation needs no estimation of who was on shift.

How did this land?

About the author

Steve Jefferson
Steve Jefferson

Developer Advocate

Steve builds something with Swarmz every week and writes up what worked, what broke, and what he'd do differently. Tutorials and hands-on guides are his lane.

Share

Get the next post in your inbox

One email a month. Product updates, engineering posts, and the best of Built with Swarmz.

I agree to receive emails about AI building tips and Swarmz product news. Unsubscribe any time.