TL;DR
A lookup table is a CSV file inside a family that formulas query with size_lookup(Table, 'Column', default, lookup_value). Column headers carry the units — Width##length##millimeters — and that header syntax causes most failures. Import via Family Types → Manage Lookup Tables. Use it whenever nested IFs pass three levels or the data is really a manufacturer catalog: hundreds of rows, one clean formula line each.
Key Takeaways
- ✓size_lookup(Table, "Column", default_value, lookup_value) — one line replaces any depth of nesting.
- ✓CSV headers encode units: Name##type##unit, e.g. Width##length##millimeters.
- ✓The first column is the key the lookup value is matched against.
- ✓The default value is your safety net — and your main debugging signal when it keeps appearing.
- ✓The table is embedded in the .rfa after import; update it by re-importing the CSV.
- ✓Catalog data in a CSV can be maintained by anyone with Excel — no Revit license needed.
Chapter 5 ended with a warning: past three nested levels, IF chains become write-only code. A real manufacturer catalog — 40 door sizes, each with its own frame, hinge count, and leaf thickness — would need nesting nobody can maintain. The lookup table is the answer: the catalog lives in a CSV, and one formula line reads it.
The size_lookup() Function
| Argument | What it is |
|---|---|
| Lookup_Table | A text parameter holding the table name (as imported) |
| "Column_Name" | The CSV column to read the result from |
| Default_Value | Returned when no row matches — must match the column type |
| Lookup_Value | The value matched against the first CSV column |
The CSV Format — Where Everyone Trips
Revit's lookup CSVs encode the data type and unit inside the column header using a double-hash syntax:
First column: the key (no unit suffix needed for text keys). Every other column: Name##type##unit. Values in the body are bare numbers — the header already told Revit they are millimeters.
Worked Example: The Door Catalog
Three steps take the CSV above into a working family:
1 — Import. Family Types → Manage Lookup Tables → Import → select the CSV. The table is now embedded in the .rfa file.
2 — Reference. Create a text parameter Lookup_Table with the table's name as its value, and a text parameter Door_Code for the key.
3 — Query. One formula per output value:
The user types D1221 — width, frame, and hinge count load themselves from the catalog. Adding a new size is one CSV row in Excel, not a formula rewrite. That also means the door schedule data can be maintained by the person who owns the door schedule — no Revit seat required.
The 5 CSV Mistakes That Break Lookups
| Mistake | Symptom | Fix |
|---|---|---|
| Wrong/missing ##unit suffix | Values off by a factor or default returned | Match header units to the parameter type exactly |
| Column name typo in formula | Default returned for every row | Copy the name straight from the CSV header |
| Units typed in the body (926mm) | Import fails or wrong values | Body cells are bare numbers |
| Saved as .xlsx not .csv | Import fails | Save As → CSV (comma delimited) |
| Edited CSV, never re-imported | Family uses stale data | Re-import after every edit — the table is embedded |
Debugging signal: the default value showing up everywhere almost always means the match is failing — check the units suffix and the key values first. The general isolation method is in the debugging chapter.
IF or Lookup? The Decision Line
Two or three outcomes with simple logic: IF statement. More than three size variants, catalog-sourced values, or data someone else maintains: lookup table. If you are already at nesting level 3 and about to add another branch — that is the line. Cross it with a CSV.
Frequently Asked Questions
Chapter 9 of 10
Hundreds of conditions, handled elegantly
All 10 formula chapters with worked examples, HD Video Vault, and the Formula Cheat Sheet. 40% off at $18.
