+ Reply to Thread
Results 1 to 2 of 2

Multiple worksheets as the source for a pivot table

Hybrid View

  1. #1
    Dan M. Hess
    Guest

    Multiple worksheets as the source for a pivot table

    Can you use more than 1 worksheet as the source for a pivot table?
    I saw where I could use multple consolidations, but I don't think
    consolidation will work for me. I need to count records by month.

  2. #2
    Forum Contributor
    Join Date
    01-23-2006
    Posts
    194
    The following may be worth trying....
    A spreadsheet called c:\JUNk\123.xls has a two worksheets 'march' and 'april' each with columns 'account', 'date' and 'value'

    On a new worksheet in the same (or another) spreadsheet use >Data >Import External Data >New database Query, select 'Excel' files as the data source. Find the spreadsheet called C:\JUNK\123.xls. Click on the 'SQL' button to display the sql code box. Enter the following....
    SELECT `march$`.* FROM `C:\JUNK\123`.`march$` `march$`
    union all
    SELECT `april$`.* from `C:\JUNK\123`.`april$` `april$`

    [may be easier to select the march worksheet into the query an click on the " * " so all the correct file and worksheet addressing is set up for you .. then edit the sql to the above format]

    The data returned by the query will be all the rows in the March and April worksheets combined into a single table that you can use as a pivot table source.

    For some reason unknown to me (using Excel 2003) a 'get external data' can get the data from 2 other worksheets in the same open spreadsheet but if you try to create a pivot table directly it will only let you do it in another spreadsheet with the source spreadsheet closed.

    regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1