# Can I create a formula where a tab name is in a cell reference?

#### sitewolf

##### Active Member
I'm not sure I'm saying this coherently.
I'm creating a spread with tabs filled with data I'm creating stats from- by and large simple counts from various columns...easy peasy.
But I'd like to create a cumulative data sheet where I use tab names as a header, in other words lining each sheet's data side by side with every other sheet.

How do I use those headers in my formula to generate stats from each sheet?
i.e. instead of referencing a tab called Data with a formula looking at Data!A1, how do a pull in that A1 data with Data as the column header?

### Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},\$Z\$1:\$Z\$99,\$Y\$1:\$Y\$99),2,False) to lookup Y values to left of Z values.

#### jasonb75

##### Well-known Member
You can do that with the INDIRECT function. Assuming header in B1,
Excel Formula:
``=INDIRECT("'"&B\$1&"'!A1")``
Note that A1 will be absolute even though there are no \$ signs. To make it relative you would either need to use R1C1 references or a more complex formula.

Also, have a read of the page linked below before using INDIRECT. There are downsides to it which are explained there.

#### Misca

##### Well-known Member
The INDIRECT function turns cell values into references:
Excel Formula:
``=INDIRECT("'"&A1&"'!B5")``
The example takes the sheet name from A1 and shows the value of cell B5 on that sheet.

#### sitewolf

##### Active Member
I greatly appreciate the answers from you both!

Replies
3
Views
113
Replies
4
Views
173
Replies
1
Views
156
Replies
37
Views
1K
Replies
0
Views
337

Threads
1,148,252
Messages
5,745,674
Members
423,967
Latest member
malayaka

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

### Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

### Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back