Google Sheets - INDIRECT Text string not working with query

bkg73123

New Member
Joined
Sep 11, 2013
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have data tables on different tabs.
I have a query formula that uses indirect on a per table reference basis to bring in the text required to complete the formula. It works fine but I want to make it dynamic by concatenating the entire text string of references together and importing that text to the query.

EXISTING STATE:
=QUERY({INDIRECT(Projects!G1);INDIRECT(Projects!G2);INDIRECT(Projects!G3);INDIRECT(Projects!G4);INDIRECT(Projects!G5);INDIRECT(Projects!G6);INDIRECT(Projects!G7)}, "select * where Col1 is not null")
This looks to the cells located on Project tab to pull in the path text for each individual table of data. It works good. But when I add a new table of data I have to go in and manually change this formula to add the new reference.


FUTURE STATE:
Project!J5 in this example would be dynamically created using CONCATENATE.
I want to create this entire text string using CONCATENATE in a dynamic way so the formula gets updated automatically when I add a new data table: Project!J5 would have this text string in it:
{INDIRECT(Projects!G1);INDIRECT(Projects!G2);INDIRECT(Projects!G3);INDIRECT(Projects!G4);INDIRECT(Projects!G5);INDIRECT(Projects!G6);INDIRECT(Projects!G7)}

I tried the following, but it gives me an error saying the text string is not a valid reference.
Compare this to my existing state to see what I am trying to do.
=QUERY(INDIRECT(Projects!J5), "select * where Col1 is not null")


Is there a way to make this formula work?

Thank you!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,222,620
Messages
6,167,086
Members
452,094
Latest member
Roberto Saveru

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