Calculating NEC tray fill with Excel365
Note, all data are maintained as Excel table. There are columns for user to enter the data and the other columns contain formula of intermediate calculation.
A. Data about the tray specification
B. Data about the cable specification
C. Data about trays
Note, the result of the NEC tray fill calculation are shown in these columns as shown above:
- FillTotal
- RuleA
- RuleB
- RuleC
D. Data about cables in trays
The file LAMBDA.txt contains the code of custom LAMBDA functions:
- fxRuleA
- fxRuleB
- fxNecTable
- fxFillA
- fxFillB
- 1C_M2: single conductor size GTE1/0 and LTE4/0
- 1C_M3: single conductor size GTE250 and LTE900
- LG: large conductor GTE1000
- LV: insulation voltage LT2000
- MC: multi-conductor
- SA: sum of cable area
- SD: sum of cable diameter
- SIG: non-power, signal
- SM: small conductor size LT4/0
- NecTable: lookup values of NEC tables
- Rule: refer to NEC code section and sub-sections of tray fill calculation
A. Configurable values for dropdown validation
B. NEC lookup tables
C. NEC rule summary
This calculation was originally developed using C#. The C# source code is available at the ElectricalFunc/src/NecFillLib Github repository. The challenge is to re-implement this calculation in Excel365 without using VBA.
Logic in Excel can be implemented as Excel formula or as VBA macro. Excel365 has many built-in formula functions that perform logic similar to the procedural statements like:
- IFS() / SWITCH() for If-ElseIf-Else
- LAMBDA recursive call for looping
- LAMBDA / LET for custom function
- Many functions for working with array of data






