Dynamic Index formula using cell references instead of cell numbers.

Tyron

Active Member
Joined
Dec 5, 2012
Messages
258
Hey guys,

Got a real brain teaser for the hardcore excel users.

Recently I have been using an INDIRECT function:
Code:
INDIRECT("'"&("WO"&$E$1)&"'!C8")

As you can see I have already started to make my worksheet functions more dynamic by using cell references. In the above example rather than hardcode the worksheet name I have used a string "WO" which means weekly order followed by the "&" symbol to concatenate with the a cell reference meaning the value that is located in the cell "E1". Which in this case happens to be a 1 for the moment. Now for my dilema.

I am trying to get the last part of this to be a cell reference as well. I no longer wish to hardcode the !C8, but instead make this a cell reference as well. In this case the value of "A8"

Someone else suggested that I might instead use an INDEX function instead, but I have yet to come up with the correct way to concatenate it all together. Here is what I have so far:
Code:
INDEX(("'"&("WO"&$E$1)&"'")&!C7:C107"&,(A8))

Unfortunately the above index function does not work.

all help is appreciated.

Ty
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
The first formula will return the value of cell C8 in the worksheet 'WO1' if cell E1 contains a 1.
 
Upvote 0
Hey steve the fish,

That is correct. Now I want to indicate to excel that I will be giving it a value in place of C8 in a different cell.

later

Ty
 
Upvote 0
Hey Andrew Poulsom,

We have a winner! lol. I am still testing on some cells, but it appears that it is working. Funny that while I was thinking some more about it I came up with:
Code:
INDEX(("'"&("WO"&$E$1)&"'")&"!"&("C7:C107"),(A8),0)
Unfortunately that caused the worksheet reference to come out as a string. lol.

I was contemplating trying the INDEX function with the INDIRECT function, but wasn't sure as Microsoft does not have any kind of reference that says what functions work within or without other functions. Would you happen to have such a resource that you could point me to? Or is it mainly trial and error?

Thanks again. This question has been solved.

later

Ty
 
Upvote 0
You can nest any function within another function provided that it returns what the outside function's relevant argument expects. That's the only rule really.
 
Upvote 0
Hey Andrew Poulsom,

Thanks. I hadn't realized that the formulas were that workable. I guess I need to book up on my functions now.

later

Ty
 
Upvote 0

Forum statistics

Threads
1,214,415
Messages
6,119,382
Members
448,889
Latest member
TS_711

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