Dynamically Reference Named Ranges?

Erik the Awful

New Member
Joined
Feb 9, 2014
Messages
11
Is there a non-macro way to dynamically reference named ranges?

I use a database at work for tracking inspections on equipment. I have no power over the database and can only pull a two-thousand-row long report with the pertinent info. The database report has an individual line for each inspection for each piece of equipment, for each location on the equipment (the equipment can have multiple parts with the same inspection). I'm also simplifying a bit, but it does not change the requirement of the formula.

Macros are locked out by our security settings. No macros, it must be done by formula.

I built a spreadsheet that takes the data and puts it into a displayable matrix. The inspections are listed in column A and the equipment is listed in row 1. Column B has the reference that requires the inspection. Column C has the location on the equipment for the inspection. The matrix shows the due dates of the inspections.

Due Dates
Reference
Loc
Machine A
Machine B
Machine C
Thingy Replacement
1.1
.
10/1/2018
11/1/2018
02/1/2019
Whatzit Inspection
1.3
.
10/3/2018
10/7/2018
9/30/2018
Gizmo Adjustment
3.2
01
4/12/2019
6/6/2019
3/4/2019

<tbody>
</tbody>

For a few years now I've tweaked and reformed the spreadsheet. I added a similar page that shows the responsible shop for performing the inspection. I added a similar page that tracks the serial number of a component that may be installed during the inspection. I added a page that can draw a monthly schedule of major inspections so I can prevent concurrent maintenance.

Now the spreadsheet takes 30 seconds to recalculate and I'd like to simplify. I changed the hard cell references in my index-match formula to dynamic named ranges that can resize when data is added and deleted, and I no longer have to worry about my cell references shrinking when other people delete the rows of the database dump.

I would like to further simplify to a single page matrix where I can click on a single drop-down menu in cell A1 and select the data displayed in the matrix.

Considering the named ranges:
DBEquip = DBase!$C:$C
DBInsp = DBase!$G:$G
DBRefer = DBase!$B:$B
DBLocat = DBase!$D:$D
DBDueDt = DBase!$E:$E
DBShop = DBase!$A:$A
DBSerial = DBase!$F:$F

Shop
Reference
Equipment
Location
Due Date
Serial Number
Inspection Name
Technicians
3.2
Machine A
01
4/12/2019
.
Gizmo Adjustment
Mechanics
1.1
Machine A
.
10/1/2018
AB432
Thingy Replacement
Mechanics
1.3
Machine A
.
10/3/2018
.
Whatzit Inspection

<tbody>
</tbody>

...and the current formula from cell D2, the upper left cell in the matrix:
=INDEX(DBDueDt,MATCH(D$1&$A2&$B2&$C2,DBEquip&DBInsp&DBRefer&DBLocat,0))

How can I replace "DBDueDt" with a dynamic reference to select between viewing due dates, shops, and serial numbers? Or have I hit the limitations of Excel?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
look at INDIRECT, replacing all your static references as needed, perhaps with another dropdown list where you pick which "DB" to access
 
Upvote 0
look at INDIRECT, replacing all your static references as needed, perhaps with another dropdown list where you pick which "DB" to access

I tried putting a cell with a dropdown for which named data to draw, but in the example above, if you put the desired data in A1 and change the formula to:

=INDEX(INDIRECT(A1),MATCH(D$1&$A2&$B2&$C2,DBEquip&DBInsp&DBRefer&DBLocat,0))

...it will give you an error. I forget which error, and I am not currently at work to try it again. As I understand it, INDIRECT() does not work with named ranges.
 
Upvote 0
Also... This array will return the range per selection of A1
=IFERROR(INDEX({"DBase!$C:$C","DBase!$G:$G","DBase!$B:$B","DBase!$D:$D","DBase!$E:$E","DBase!$A:$A","DBase!$F:$F"},MATCH(A1,{"DBEquip","DBInsp","DBRefer","DBLocat","DBDueDt","DBShop","DBSerial"},0)),"Selection not found")
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,666
Members
448,977
Latest member
moonlight6

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