Most pivot tables in Excel are built using a simple Excel list as the data source. This is the default in the pivot table wizard. We can also base pivot tables on external data. Typically the external data is taken from a database or text file, however there are also advantages to working with external data when the original data is kept in Excel worksheets. This example uses Excel 2003, you can do the same thing in Excel 2007, but the dialogs are slightly different.
Let's say we have a range containing hours worked on a project by each department. We create a named range called 'HoursWorked' to hold this data. We could use OFFSET and COUNTA to create a dynamic range if this was a real application, but for this sample we only need to create a simple range.


Assume that each department charges a different hourly rate for their work. This is kept in a separate worksheet range called 'DeptRetes' as shown below.

If we want to show Total Cost = Hours * StdCost, the usual method in Excel is to use a VLOOKUP formula to put StdCost for each department in a column to the right of the 'HoursWorked' range. We could then use a pivot table to summarise our results.
Another way of doing this is to save the data in a workbook and use that workbook as an external data source for a pivot table. To do this, first close the data workbook. We cannot use an open workbook as an external data source. Then open a new workbook and create a pivot table. In step 1 of the wizard, check the 'External data source' option.

Click next, then click the 'Get Data' button. Choose 'Excel files' as the data provider and make sure that the checkbox 'Use the Query Wizard to create/edit queries' is not checked. Then click 'OK' and locate the Excel file containing the data. Each named range in the data workbook is available as a table in MS Query. You can add tables to the query designer, and click-and-drag between table columns to create relationships. In fact, this is very similar to the Access query designer.
Here we build a relationship between the two tables using [Department] as the key.

When you have finished building a suitable query, click the fourth button from the left on the MS Query toolbar (it looks like an arrow pointing out the door) to return the data to Excel. This returns to the pivot table wizard where we proceed to define the pivot table.
In this example we can create a calculated field to define [Billable] as the product of [Hours] and [StdCost] as shown.

The finished pivot table can look like this.

This method of relating data ranges can be used with several data sets that are kept in separate sheets in one workbook. It allows for reasonably complex database-style queries to be used entirely within Excel.