LocalExcelTool
Get started

Excel data validation formulas

The formula to paste into Data Validation for unique, list, number, date and email rules.

Runs in your browserNo account neededFree

What is Excel data validation formulas

Data validation is a gate on what can be typed into a cell. It is driven by a formula or a source range, and getting that formula wrong is why validation 'does not work' — usually because the reference is relative where it needed to be absolute. Each rule here comes with the exact steps and the reason for its reference style.

🔒 Everything runs in your browser. Nothing is uploaded.

What this tool actually does with your file

Where it runs
In your browser, on this page
Upload
None — the file never leaves your device
Offline
Works with the network disconnected

What each rule gates

Every rule is a formula or a source range that must evaluate TRUE for the entry to be accepted. The formulas here use absolute references ($A:$A) on purpose: a relative reference shifts per cell and silently validates the wrong row.

Why validation seems not to work

It only fires on new typing or pasting into the cells. Data already in the sheet is untouched, and a paste of a whole block can bypass it in some versions. Validation is a gate at the door, not a cleanup.

When not to use it

When you need the sheet to survive being edited by someone else's macro or an import. Those write straight to the cells. If the data arrives by import, validate after the import with a formula column instead. Write the error message as an instruction, not a complaint. "Enter a date after today" gets the entry fixed; "Invalid value" gets the cell cleared and retyped the same way.

How to use it

  1. 1.Pick the rule you need.
  2. 2.Select the target cells, then Data → Data Validation.
  3. 3.Paste the formula as a Custom rule and set the error message.

How Excel data validation formulas works under the hood

An .xlsx file is not a table — it is a ZIP archive of XML parts. Everything you see as a grid is rebuilt from cell references on this page, in memory, without a round trip to a server.

  1. 1

    Read the file as bytes

    The file is read into an ArrayBuffer with the File API. This is a local read, not a request — nothing leaves the tab.

  2. 2

    Unzip and parse the workbook

    SheetJS inflates the archive, reads workbook.xml for sheet order, sharedStrings.xml for text, and each sheet's XML for cells and types.

  3. 3

    Rebuild rows in memory

    Cells are placed by their A1 reference, gaps become empty cells, and the sheet is materialised as a two-dimensional array.

  4. 4

    Write the output locally

    The result is serialised to CSV text or a new workbook and handed to the browser as a Blob download.

  5. Processing pipeline

Why formulas arrive as values

A spreadsheet stores two things per formula cell: the formula text, and the value Excel last computed and cached. A browser parser reads the cached value. Making the formula itself run would mean reimplementing Excel's calculation engine — including volatile functions, circular-reference detection and locale-specific parsing. So the exported CSV contains what you last saw on screen, not a live formula.

What has no CSV equivalent

Merged cells, cell fills, fonts, conditional formatting, comments and pivot tables have no representation in a comma-separated file. A merged cell becomes its value in the top-left position and empty cells elsewhere. Dates are written as dates only when the cell is typed as a date; a date stored as text stays text. These are format limits, not bugs.

Where it gets slow

Parsing is linear in cell count, and the browser holds the whole workbook in memory. A 30 MB file with a million populated cells can take several seconds and a few hundred MB of RAM; the tab may feel frozen while SheetJS works. Splitting the file by sheet, or exporting only the range you need, is faster than retrying with a bigger limit.

Verify it yourself

You do not have to take this on faith. Run the tool once with DevTools open.

  1. 1.Open DevTools on this page and switch to the Network tab
  2. 2.Keep the filter on Fetch/XHR and run the tool
  3. 3.Confirm no request carries your file — you should see only page assets and fonts

Frequently asked questions

Why is my validation not stopping anything?

Three usual causes: the rule was applied to the wrong range, the formula used a relative reference that shifts per cell, or the data was already in the cells (validation only gates new entries).

Can validation remove existing bad rows?

No, and it never will. It evaluates as you type. Existing problems need Find & Select → Go To Special, or the cleanup tools in this section.

What this kind of conversion cannot keep

Spreadsheet conversion is lossy by nature: a workbook carries formulas, styles, merged cells and multiple sheets, while CSV carries rows of text. This tool keeps values and order, recalculates nothing, and drops presentation on purpose. That is why it can run without a server — and why a converted file will not look like the original.

More in Spreadsheets & Docs