Power Query Problems

Use Power Query to Look Up Scores Across Multiple Excel Tables

John WilsonJohn Wilson Dec 2, 2026 868 views

Question details

Select the appropriate specialty table and return a score based on a revenue range.

Look Up Scores Across Multiple Excel Tables with Power Query
Product
Microsoft Excel Power Query
Device & OS
not provided
Scenario
A workbook contains 40 structured tables with identical headers, each associated with a specialty.
Observed behavior
The desired result is a score from the row whose specialty and lower and upper revenue limits match the input.
Before you start

Check that the source tables have consistent headers and that each table can be mapped to a specialty. Decide whether the upper revenue limit is inclusive or exclusive, and check for overlapping ranges within each specialty.

Solution 1Recommended

Combine the tables with Power Query and look up the score

Use one normalized table to make specialty and revenue lookups easier to maintain, even if the source tables remain separate.

The example below assumes each source table is named with the prefix tblSpec_ followed by the specialty value, such as tblSpec_Cardiology. If your names do not map directly to specialty values, create and use a separate mapping instead.

The example formula treats the lower limit as inclusive and the upper limit as exclusive. Adjust the comparison if your ranges use different boundaries.

1
Open the workbook tables in Power Query

In Excel, select Data > Get Data > From Other Sources > Blank Query. In the Power Query formula bar, enter = Excel.CurrentWorkbook() and press Enter.

2
Filter the source tables

Use the Name column filter to keep only table names beginning with tblSpec_. This also prevents the combined output table from being included when the query refreshes.

3
Add the specialty

Select Add Column > Custom Column, name it Specialty, and enter Text.AfterDelimiter([Name], "tblSpec_"). Verify that each resulting value matches the specialty used in your lookup.

4
Expand and load the data

Select the expand button on the Content column and choose the lower-limit, upper-limit, and score columns. Set appropriate data types, then select Home > Close & Load. Name the resulting Excel table tblRanges in Table Design.

5
Enter the lookup formula

With the specialty in B2 and revenue in C2, enter =XLOOKUP(1,(tblRanges[Specialty]=B2)*(C2>=tblRanges[LowerLimit])*(C2<tblRanges[UpperLimit]),tblRanges[Score],"No match"). Replace the example column names with your actual headers.

6
Refresh after source changes

Select Data > Refresh All after changing a source table or adding another table that follows the naming convention.

Combine the tables with Power Query and look up the score
Check range boundaries: XLOOKUP returns the first matching row. Avoid overlapping ranges for the same specialty and test values at each boundary. XLOOKUP requires an Excel version that supports it.
Free Microsoft Office alternative

Work with Specialty Score Tables in WPS Spreadsheet

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface. Open compatible Excel workbooks and work with consolidated specialty and score data while moving between office suites.

Review and filter consolidated specialty and revenue-range dataOpen and save Microsoft Excel XLSX workbooksUse a familiar spreadsheet interface for an easier transitionWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Can I keep the 40 source tables separate?

Yes. Power Query can combine their rows into a separate output table while leaving the source tables in place. Use Data > Refresh All after changing the sources.

How does the lookup identify the correct specialty?

The query adds a Specialty column derived from each source table name. The XLOOKUP formula compares that column with the specialty input in B2.

What happens when revenue equals an upper limit?

In the example formula, the upper limit is exclusive because it uses C2<tblRanges[UpperLimit]. Use <= instead if upper limits should be inclusive, and check that adjacent ranges do not overlap.

Why does the formula return No match?

Check that the specialty in B2 exactly matches a value in tblRanges[Specialty], that C2 is numeric, and that a row covers the revenue value. Confirm that the query was refreshed after source changes.

Will a newly added specialty table be included?

It will be included on refresh if its name begins with tblSpec_, its suffix matches the specialty value, and it has the expected columns. Select Data > Refresh All to update the combined table.