Worksheet Names Pull-Down in Formula?

dougbert

Board Regular
Joined
Jul 12, 2007
Messages
91
None of my searches on the forum seemed to directly address my problem. Seems simple enough. I'm hoping it's just a syntax error, but can't seem to wrap my head around what I'm missing.

In cell $A$1, I have a data validation, pull down menu with a listing of worksheets names contained within the same workbook. $A$1 is formatted as Text. Each worksheet name in the drop down list is surrounded by single quote marks.

I want to reference the value in cell $A$1 in a formula where that value will be the worksheet name. Here is the formula I tried that obviously doesn't work:
=IF(ISERROR(AVERAGEIFS($A$1!$AB$3:$AB$700,$A$1!$AB$3:$AB$700,"<>0")),"N/A",AVERAGEIFS($A$1!$AB$3:$AB$700,$A$1!$AB$3:$AB$700,"<>0"))

Pressing Enter results in an error with the first occurrence of $A$1 highlighted in the formula bar.

I will be adding additional criteria to this formula, which is why I'm using AVERAGEIFS. However, I need this simpler formula to work first.

Can anyone spot my syntax (hopefully) error?

If what I want to do is impossible, I'd appreciate any suggestions anyone might offer.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
You can't simply insert a cell value within part of a cell reference. You have to use the INDIRECT function to do something like that. The INDIRECT function allows you to "build" a cell reference from text strings.

Replace this...
$A$1!$AB$3:$AB$700

With this...
INDIRECT($A$1 & "!$AB$3:$AB$700")

Be aware that the data validation in cell A1 may not interpret your quotes properly. You may want to omit them from the Data Validation list but include them in the INDIRECT formula e.g.
INDIRECT("'" & $A$1 & "'!$AB$3:$AB$700")
 
Upvote 0
Thanks for the education AlphaFrog! While I knew the INDIRECT function existed, I'd never used it before. So, naturally, it never occurred to me. Trust me...it's in my toolbox forevermore!

Your last example was perfect and solved my issue!

Thank you so much! :pray:
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,909
Members
452,949
Latest member
beartooth91

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