Skip to main content

How to Set a Minimum and Maximum Value for a SharePoint Number Column

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

A Number column accepts any number unless you tell it otherwise. Minimum allowed value and Maximum allowed value set the range, and SharePoint refuses to save anything outside it. It's the simplest guard a list can have.

In the Overtime Timesheet series, the Hours column of the OvertimeEntries list holds the hours worked in one shift. That can't be less than 0 or more than 24, so those are its limits.

Prerequisites​

Step 1: Open More Options​

In the Create a column panel for a Number column, select More options. For a column that already exists, open Settings (the gear) → List settings and select the column under Columns.

Step 2: Set the Range​

Fill in Minimum allowed value and Maximum allowed value. For Hours, they're 0 and 24:

The Create a column panel for Hours with Number of decimal places 2, the preview 123,456.00, and under More options Minimum allowed value 0 and Maximum allowed value 24 outlined in red, above Require that this column contains information Yes

Either box can stay empty. BreakMinutes, in the same list, has only a minimum, 0: a break can't be negative, and the list's validation rule makes sure it's shorter than the shift (How to Add List Validation in SharePoint to Compare Two Columns).

Select Save.

What Happens Outside the Range​

I filled in a new item with a valid night shift, 22:00 to 06:00 the next morning, and 25 in Hours:

The Hours field of the new item form with 25 typed in and outlined in red, with the description Hours worked: the time from start to finish, minus the break. Worked out by the app

Leaving the field showed no message. Selecting Save did: SharePoint refused the item and showed this at the top of the form:

The top of the new item form with the message Error: The value of this field must be between 0.00 and 24.00 outlined in red, above the WorkDate field

The limits appear with two decimal places, like the column. Nothing was saved, and the list stayed empty.

Two things to know about when the check runs:

  • On save, not as you type. The form doesn't warn you when you leave the field.
  • After the required fields. With required fields still empty, the form first shows You can't leave this blank. under each of them, and only checks the range once they're filled in.

Common Mistakes​

MistakeWhat happensDo this instead
Setting a maximum on a column that totals thingsReal totals get refusedLimit single values, such as one shift, not running totals
Expecting a warning as you typeThe message only comes when you saveCheck the top of the form after Save
Using the range to compare two columnsA range can only hold fixed numbersUse list validation to compare columns

Troubleshooting​

SymptomLikely causeFix
The value of this field must be between …The value is outside the rangeEnter a value inside it, or widen the range
Old items have values outside a new rangeThe range applies when items are savedEdit those items, or leave the range wider
The range fields aren't thereThe column isn't a Number columnCheck the column's type in List settings

FAQ​

Can the minimum be negative?​

Yes. Leave Minimum allowed value empty for no lower limit, or enter any number.

Does the range apply to apps and flows too?​

The range is a setting of the column, not of the form. Even so, an app should check its own values before saving: the Overtime Timesheet app checks the hours itself, so people see a clear message in the app instead of a save error.

Conclusion​

More options → Minimum allowed value and Maximum allowed value → Save. SharePoint then refuses any value outside the range with The value of this field must be between…, when the item is saved.

Additional Resources​