Data query source & criteria vary with cell value

PhilFish

New Member
Joined
Oct 25, 2005
Messages
5
I have been using Excel's data query function.

I have been able to set parameters so they are dependent on cell values. However, I want to make the Data source and Criteria dependent on cell values as well.

To be more specific, I have several worksheets, which function as separate databases. They relate to successive financial years, and so are called 0203, 0304, 0405, etc.

Each database contains column headings relating to risk categories: Governance Risk, Financial Risk, Compliance Risk, etc.

Each entry in the database contains a risk score: Low, High, Medium.

So, an organisation is given a High Financial Risk in 0405, or a Low Compliance Risk in 0304, and the results are stored in the relevant database.

I can run a Data Query using, say, the 0405 database as a Data Source and the Governance Risk column as a Category. The Parameter is based on a cell, into which user can type "Low", "Medium" or "High". This works very well, and the records pops up withoiut bother.

However, I want to have two further cells, where the user can type 0405 or 0304 to specify which database they want the data to come from, and "Governance" or "Financial" to specify what type of risk they wish to look at.

Is it possible? I'd like to avoid VBA if possible, but will take the plunge if I need to.

Thanks in advance!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,018
Messages
5,834,973
Members
430,330
Latest member
drAli77

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
Top