40% OFF! — Limited Time Offer
← Back to Articles

July 19, 2026

·By El Alaoui Mohamed

Revit Lookup Tables: Replace Nested IFs With CSV Integration

Revit lookup table CSV integration replacing nested IF formulas

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

size_lookup(Lookup_Table, "Column_Name", Default_Value, Lookup_Value)
ArgumentWhat it is
Lookup_TableA text parameter holding the table name (as imported)
"Column_Name"The CSV column to read the result from
Default_ValueReturned when no row matches — must match the column type
Lookup_ValueThe 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:

Door_Code,Width##length##millimeters,Frame_Depth##length##millimeters,Hinge_Count##number##general D0821,826,100,3 D0921,926,100,3 D1021,1026,125,3 D1221,1226,150,4

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:

Door_Width = size_lookup(Lookup_Table, "Width", 926mm, Door_Code) Frame_Depth = size_lookup(Lookup_Table, "Frame_Depth", 100mm, Door_Code) Hinge_Count = size_lookup(Lookup_Table, "Hinge_Count", 3, Door_Code)

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

MistakeSymptomFix
Wrong/missing ##unit suffixValues off by a factor or default returnedMatch header units to the parameter type exactly
Column name typo in formulaDefault returned for every rowCopy the name straight from the CSV header
Units typed in the body (926mm)Import fails or wrong valuesBody cells are bare numbers
Saved as .xlsx not .csvImport failsSave As → CSV (comma delimited)
Edited CSV, never re-importedFamily uses stale dataRe-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.