Indirect function

meglan

New Member
Joined
Aug 12, 2014
Messages
7
Hi my friends!

I am in need of some help with the INDIRECT function (I think). I have a cell (B2)with a drop down that contains the names of 10 sheets I have in the workbook (i.e. Women, Men, Children). Each sheet contains the same data within the same cell on each page (i.e. revenue in cell E6, etc).

What I am trying to do is create a table that will change the data within in based upon the sheet selected in cell B2. I am using the formula below with my drop down in B2 and the value I am trying to capture on the corresponding sheet in cell E6. It seems that no matter what I try, I keep getting and #REF error. I used the formula below.

Does anyone have ANY idea what is wrong with this?? Thank you!!!!!

=INDIRECT("'"&B2&"'!"&E6)
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
This should work
Code:
=INDIRECT(B2&"!e6")
 
Upvote 0
I think that was my original problem; several sheets had spaces. I finally figured that was why some were working and others were not. Thank you!
 
Upvote 0
The indirect function turns text into a reference. If you are having problems then just do what you want without the indirect. For example enter = then go to your other sheet and select the cell. You will then know the reference you want to build inside the indirect function for example

Code:
='this hasspace'!A7

What you put inside the indirect function needs to create that.
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,380
Members
448,955
Latest member
BatCoder

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

Which adblocker are you using?

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
Back
Top