How do you reference a data table column from another worksheet?

23,003

There are a couple of ways. The easiest is to just select the relevant part of the table e.g., B2:B100, assuming your table has headings and the data is in rows 2 through 100. Excel will automatically insert somthing like:

TableOnSheet1[DataToCount]

so that your whole formula looks like:

=COUNTIF(TableOnSheet1[DataToCount], [T2Col1])

Which is the table name followed by the column header in brackets.

You can, and should, name your tables. Do so by clicking on the Design tab with the table selected and then editing it in the Table Name box on the far left.

You can also write your formulas using autofill for the table name, e.g., if you type = "=COUNTIF(Table" Excel Intellisense will offfer "Table1," "Table2," and any other tables in the workbook.

Share:
23,003
Giffyguy
Author by

Giffyguy

I enjoy writing hardcore OO data-structures in native C++.

Updated on November 10, 2020

Comments

  • Giffyguy
    Giffyguy over 3 years

    Microsoft Excel 2010 -
    I have two worksheets, Sheet1 and Sheet2.
    Both worksheets have data-tables on them, covering differents types of data - illustrated below.

    <Worksheet "Sheet1">
        <DataTable "Table1">
            <Columns>
                <Column "T1Col1" />
                <Column "T1Col2" />
            </Columns
        </DataTable>
    </Worksheet>
    
    <Worksheet "Sheet2">
        <DataTable "Table2">
            <Columns>
                <Column "T2Col1" />
                <Column "T2Col2" />
            </Columns
        </DataTable>
    </Worksheet>
    

    Currently, every cell in T2Col2 contains a function like this:

    =COUNTIF('Sheet1'!B:B, [T2Col1])
    

    I'd like to replace "B:B" with a bracketed column reference to [T1Col2], but I am uncertain how to accomplish this between seperate tables and worksheets.