Excel Training: Manual Methods
Option 2: Using Named Ranges, Intersection Operator, and Indirect
For standard workbooks, a simple
copy-and-paste of title names and individual cell references can transform
table data easy for a human to read into list data for computer analysis or
for upload to a database.
But for our non-standard worksheets, we'll use named ranges to identify
services and services packages that actually exist on the spreadsheet, the
intersection operator to pull out data by service/service package
combinations, and the indirect operator to help us quickly set up our
formulas.
Use Named Ranges To Identify Services And Packages
If you're like most of our customers, you aren't quite confident
that some lone wolf won't send in their own version of 'standard'. In this
section, we put some little-known features of Excel to work in order to
overcome this obstacle. Named ranges are a great help in Excel
spreadsheets. If you don’t know about them, see our
June 2002 article on the
web page. Sometimes a named range is a single cell like “AnnualGrowthRate”
which is used in formulas all over the spreadsheet.
In our case, the named
ranges represent the rows of services and the columns of service packages.
We can then use the intersection operator to pull the values from each
intersection of column named range and row named range. For instance, find
the number at the intersection of Service4 and Bronze. This formula can be
used to interrogate the spreadsheet and retrieve all of the data in format
we need. Moreover, we can quickly create the named ranges on each
spreadsheet as we open it. The problem of non-standard spreadsheets goes
away! If one spreadsheet is missing a service or service package, it won’t
mess up our formulas. Let’s try it.
Open a sample spreadsheet and select the range from A2 to the last used
cell. Then go to Insert > Name > Create…
Leave the boxes marked Top row and
Left column checked as we want to use both the service and the service
package names in our named ranges. Click OK. We're done!
Now with our named ranges created, we’ll use the intersection operator to
pull out our values.
Intersection Extracts Data From Table Cells
The intersection operator works with a list of service, service package
combinations. In the named range step, we created the ranges. In this step,
we'll use the combinations to extract the relevant data.
Just like our previous example, this list can be kept in the master
workbook and copied whole into each source workbook for ease of use. When
ranges are missing (because the field rep didn’t put them in the report), an
error will be generated but we can ignore them very easily in the final data
sort.
If you haven't already seen the video for the standard version, you can
watch it in Windows Media or
Real Media.
The technique is the same except for the actual formulas to type in the
third column. Watching the process may help make it more clear.
To create a list in the master workbook:
- Copy the list of services.
- Paste the list five times, one right after the other, for each of the
five service packages.
- Go back to the top of the workbook and copy the first package -
“None”.
- Highlight the cells alongside Service1 to Service11 and then click
Paste – the word “None” will be copied alongside each service name.
- Go back to the top of the workbook and copy each service package in
succession, following steps 3 and 4.
- Type the formula with the intersection operator into column three, and
drag the formula to the bottom of the list, or double-click on the Fill
Handle to do it automatically. We'll see how to implement this step in the
paragraphs following.
If you’ve never used the intersection operator, you might want to try it
once before using it in our list. As we mentioned, intersect goes to the
overlap between named ranges and displays the result. Since we have row
named ranges and column named ranges, our intersection is a single value.
The intersection operator is very strange in that there is no name, like
=NPV() and no obvious operator like +, -, or *. The operator is just the
space key, which we'll display as <SPACE>. To test this operator, go the
sheet where you've created named ranges. Type the following into any cell:
=(Service1<SPACE>None)
Or really
=(Service1 None)
You should get a value like 4 or 12 or 0: whatever is at the
intersection of Service1 and None.
Have you got that? Good. We need to introduce one more little-known
function in Excel called Indirect before we complete this part.
|