> ## Documentation Index
> Fetch the complete documentation index at: https://upsheets.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Shift Types in Smart Formulas

> Set up day and night shifts, choose which rules apply, and select shift types from your data, start times or a default.

## Use Different Rules for Different Shifts

Shift types let you use different daily rules within one Smart Formula. For example, you can apply one ordinary rate to Day shifts and another to Night shifts.

You define shift types on each formula to determine how timesheet lines get their type. You can supply shift names in your data, set up automatic selection using start-time windows, or use a default for every line. You can also combine these options.

UpSheets selects a type in this order:

1. **Supplied shift name:** Supply **Shift type** in your data, or select a type in the upload editor. A supplied name takes priority over the start-time windows and default. It must match a type defined on the employee's formula; an unknown name reports an error rather than falling back.
2. **Start-time window:** If the shift name is blank, UpSheets checks the line's start time against each type's optional **Start from** and **Start to** window. The first matching type is used.
3. **Default shift type:** If no window matches, no windows are set, or the line has no start time, UpSheets uses the type marked **Default** on the formula.

For example, define **Day** as the default and give **Night** a start window of **18:00–06:00**. A blank shift name on a line starting at **20:00** selects Night. A blank name on a line starting at **09:00** selects Day. Supplying **Day** on the 20:00 line overrides the Night window.

If your data already supplies reliable shift names, leave the start-time windows blank. If it only supplies start times, use windows to select types automatically. If all lines normally use one type, set that as the default and supply another name only for exceptions.

The selected type stays the same across the whole shift, including after midnight.

## Enable Shift Types

1. Select **Smart Formulas > Configure**.
2. Open **Settings**.
3. Set **Enable shift types** to **Enabled**.

This shows shift-type controls in the formula editor, import mapping, upload editor and simulator.

## Set Up a Formula

Open an editable Smart Formula draft from **Smart Formulas > Configure**. In the **Shift Types** summary, select **Edit**.

1. Select **Add shift type** and enter a name, such as **Day** or **Night**.
2. Optionally enter **Start from** and **Start to**.
3. Use **Set default** to choose the fallback type. The selected type shows a **Default** badge.
4. Select **Save**.

The **Shift Types** row shows toggle buttons for each configured type plus **Unset**, and an **Edit** or **View** action to change type names, start-time windows and the default. Published formulas show these settings read-only; create a new draft version to change them.

## Filter Rules by Shift Type

On the formula editor, the **Shift Types** row filters the **Rules** table. **Unset**, **Day**, **Night**, and any other configured types appear as toggle buttons. All options start selected, so every rule is visible until you change the selection.

* **Unset** includes rules with no shift limit in the rule editor (they apply to every shift type).
* Each shift type includes rules limited to that type. A rule limited to more than one type stays visible when any of those types is selected.

To review rules that matter for one shift, for example **Night**, together with rules that apply to every shift:

1. Leave **Unset** and **Night** selected.
2. Deselect every other shift type.

The table then shows apply-to-all rules plus **Night** rules, and hides rules limited only to other types (for example **Day** only).

To list rules limited to **Night** only, without apply-to-all rules:

1. Deselect **Unset** and every other shift type.
2. Leave only **Night** selected.

The filter works together with **Search** above the **Rules** table. If nothing matches, the table shows **No rules match this filter.**

## Choose Which Rules Apply

In the formula editor, open a rule or select **Add rule**. The **Shift Types** dropdown appears after **Priority** when shift types are enabled, the formula has types, and the rule supports them.

* Select one or more types to limit that rule to those shifts.
* Leave the selection empty to show **All** and apply the rule to every shift type.
* Clear the selection to return to **All**.

The Rules table shows small shift badges after names of rules with a specific selection. Rules set to **All** have no shift badge.

Shift selection is an extra condition. The rule's days, time or hour range, priority and other conditions still apply. Selecting a shift does not make a rule apply to every hour automatically.

Weekly overtime rules and weekly allowances cannot be limited to a shift type.

### Optional Start Times

Use shift times when you want UpSheets to choose the shift type automatically, without supplying a shift name on every timesheet line. This is useful when your data has start and end times but no shift names.

**Start from** and **Start to** define the range of start times that identifies that shift type. For example, give **Night** a window of **18:00–06:00**. A line starting at **20:00** is then treated as Night, so rules limited to Night can apply. A line starting at **09:00** does not match that window and uses another matching type or the default.

These fields classify the **whole shift by when it starts**. They do not set the shift's duration, restrict its paid hours, or change its type when the clock passes the window boundary. A Night shift starting at **20:00** and ending at **08:00** remains Night for the whole shift, even though it ends after **06:00**. Use each rule's time or hour range to control which hours it pays.

Enter both times or leave both blank. A window can cross midnight: **Start from 18:00**, **Start to 06:00** can identify a Night shift that starts in the evening or early morning. If windows overlap, the first matching type in the list is used. Use separate windows to keep selection clear.

Both window boundaries are included. If the two times are identical, the window matches any start time.

Start times are optional. Leave both blank if you supply shift names in your data or want to use the default. An explicitly supplied shift name takes precedence over the start-time windows.

## How a Timesheet Gets Its Shift Type

UpSheets checks each line in this order:

1. **Shift type supplied:** Use the named type configured on the employee's Smart Formula. Names are matched without regard to capitalisation, so `night` matches **Night**.
2. **Start time matches a window:** When the supplied type is blank, use the first matching start-time window.
3. **Default:** When no window matches, or the line has no start time, use the formula's default type.

An unknown supplied name produces a validation error. It does not fall back to the default. Correct the name or add that type to the employee's formula.

For file imports, map your optional shift-name column to **Shift type**. You can also select a shift type in the upload editor or simulator. A blank value uses automatic selection as described above.

## Simple Examples

### Day and Night Rates

Define **Day** as the default and **Night** with a start window from **18:00** to **06:00**. Add daily ordinary rules for the required days and hours:

| Rule | Shift Types | Rate |
| - | - | - |
| Day ordinary | Day | 1× |
| Night ordinary | Night | 1.5× |

A line starting at **20:00**, with no supplied shift name, selects **Night**. A line starting at **09:00** falls back to **Day**. A supplied value of **Day** overrides the Night start-time window.

A daily rule set to **All**, such as a shared daily overtime rule, remains eligible for both types when its other conditions match.

### Supplying Shift Names in Your Data

Define **Day** and **Night**, leave their start windows blank, and make **Day** the default. Supply `Day` or `Night` as the **Shift type** in your data.

A line containing `Night` uses Night rules. A blank line uses Day. A line containing an unconfigured name, such as `Evening`, reports an error so you can correct it before uploading.

## Check Your Setup

Use [Simulate](/docs/smart-formulas/simulate) before [publishing](/docs/smart-formulas/publish-and-version) and [assigning](/docs/smart-formulas/assign) the formula. Check an explicit shift name, a blank value, a start-window match and a shift crossing midnight. Include weekend or public-holiday cases if your formula uses them.

If shift controls are missing, check that the organisation setting is enabled, the formula defines types and the rule supports shift selection.

You cannot disable shift types while formulas in the organisation still define types. Turning off the organisation setting does not silently remove saved calculation settings.

For rates that change at midnight, see [Next-Day Rates](/docs/smart-formulas/next-day-rates). This is a separate formula setting and works with or without shift types.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.