Skip to main content

5-Digit ZIP Code (Formula)

This column validation uses a SharePoint formula to require a ZIP code to be exactly five numeric digits. Applied as column validation, it checks the value the moment someone saves the item and blocks entries that do not pass.
Built with
Features
Column Validation, Single Line of Text Column
Category
Formulas

Want one like this?

Talk to Greg
  • What it does: Requires the Zip to be exactly five digits, numbers only.
  • If it passes: The ZIP is five numeric digits, so the item saves.
  • If it fails: SharePoint blocks the save and shows your message, for example: Enter a 5-digit ZIP code, numbers only.
  • US ZIP-code entry
  • Clean address data
  • Preventing malformed ZIPs
  • Mailing-list quality
  • Formula Type: Column Validation
  • Formula Category: Text & Names
Display nameColumn type
ZipSingle line of text
  1. Create the column the formula reads: Zip
  2. Add or edit a few items so there is data for the formula to work with
  1. Open the column you want to validate (Edit column, then More options)
  2. Expand Column validation
  3. Paste the formula below into the Formula box
  4. Add a user message that explains the rule, so people know why an entry was blocked
  5. Save. From now on, new or edited entries must pass the rule
=AND(LEN([Zip])=5,ISNUMBER(VALUE([Zip])))
What does this formula do?

Format + numeric check. It runs as column validation, so it checks the value when the item is saved and blocks entries that do not pass.

Which columns do I need to set this up?

You need: Zip (Single line of text). The formula reads these to produce its result.

Will it check items that are already in the list?

No. Validation applies only to new or edited entries. Existing items are not re-checked when you add the rule.

If LookBook 365 is code-free and out-of-the-box, why does this example use a formula?

A SharePoint formula is native, declarative configuration, not custom development. It only works with the item’s own fields and simple logic – it cannot run scripts, reach external services, or change other data, and nothing is deployed to your tenant. It keeps working through Microsoft updates. If you would rather not set this up yourself, this is exactly the kind of thing I configure for clients.

5-Digit ZIP Code Formula Example
5-Digit ZIP Code Formula Example