Skip to content

Referencing tables in formulas

Jan Källman edited this page Dec 12, 2022 · 10 revisions

EPPlus / OOXML has a somewhat different way of referencing cells inside tables, than used in the Excel GUI.
Addresses within tables can be referenced either relative or absolute in a formula.

A table address always starts with the table name, followed by a section of the table and/or a column wrapped in brackets. For example:

Syntax Description
Table1[#all] Reference the whole table including headers and totals
Table1[] Reference the data part of the table excluding the headers and totals. This is the same as Table1[#Data]
Table1[Column1] Reference the data part of the column "Column1" within the table Table1
Table1[[#This Row],[Column2]] Reference the row at the same row as the formula cell of column "Column2" within the table Table1. In Excel this would look like Table1[@Column2]
Table1[[#Data],[#Totals],[Column2]]]] Reference the data and totals part of the column "Column2" within the table Table1
Table1[[#Headers],[Column1]] Reference the header cell of the column "Column1" within the table Table1
Table1[[Column12]:[Column2]] Reference the data part of column "Column1" to "Column2" within the table Table1
Table1[[#Data],[#Totals],[Column12]:[Column2]] Reference the data and totals part of column "Column1" to "Column2" within the table Table1

EPPlus wiki

Versions

Worksheet & Ranges

Styling

Import/Export data

Formulas and filters

Charts & Drawing objects

Tables & Pivot Tables

VBA & Protection

Clone this wiki locally