Hi, Is it possible to create pivot table with multiple sheets? i have a huge data with as much as 2000000 rows and want to summarize it with help of pivt table. pls help me out.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
pivot table (xp professional)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » pivot table (xp professional)
- This topic has 34 replies, 5 voices, and was last updated 15 years, 10 months ago.
Viewing 1 reply threadAuthorReplies-
WSsdckapr
AskWoody Lounger -
WSrory
AskWoody Lounger -
WSprasad
AskWoody Lounger -
WSHansV
AskWoody LoungerMay 30, 2008 at 9:21 am #1110944You wrote that you have as much as 2 million rows. In Excel 2002 (XP) you’d need more than 30 sheets to store the data, not 6. That doesn’t seem very practical. You should move the data into a single table in a database such as Microsoft Access or SQL Server.
(Just as an illustration, I have attached your workbook with a pivot table based on multiple ranges. See Excel — Pivot Tables — Multiple Consolidation Ranges for a step-by-step description.)
-
WSprasad
AskWoody Lounger -
WSrory
AskWoody Lounger -
WSprasad
AskWoody Lounger -
WSrory
AskWoody LoungerMay 30, 2008 at 2:04 pm #1110959My point was that looking at your sample seems to imply that you want to end up with one long list from all the raw data sheets – i.e. you want one line in the pivot table for each line in the raw data. If so, you will run out of rows. If not, can you clarify what the groupings are and whether you just want a straight sum of each of the values.
-
WSprasad
AskWoody LoungerMay 31, 2008 at 5:59 am #1111044Actually, the data consisting sale of a particular product to different customers in a particular period and requirement is to get detail of one or all customer for whole period in given format. I am doing this with macros,which is very complexd and time taking also. Moreover, it is required to record macro each time a new customer added. The only problem is volume of data. Is there any simple way to do it?
-
WSsdckapr
AskWoody LoungerMay 31, 2008 at 1:39 pm #1111052It sounds like you want to use a system that is able to handle the larger datasets directly. This suggests to me something more like Access (even if you had XL2007s larger worksheet size)….
If you must keep it in excel in multiple sheets and want to extract some summary sheet, you will have to be specific about what you want the macro to do if you are asking for help in macro writing.
But has been pointed out, if you want to display all the customers in one sheet with details, you will come upon the sheet limitations in XL pre-2007
Steve
-
WSprasad
AskWoody Lounger -
WSprasad
AskWoody LoungerJune 30, 2009 at 11:54 pm #1167171Hi Steve, This is what I need exactly. can u write some simple macro to perform task?
I am not sure whether I should re-open the topic but since it remain un-resolved(so far i am concerned), I take this liberty to do this. It took me almost a year or so (ofcourse I set the issue aside in between) to discover how to consolidate the multiple sheets in a single pivot table. Quote from the link provided by rory:
“It can be done entirely within Excel. Go via menu data, import external data, new database query. Excel files. OK. Select your file. If you don’t have defined names for the data the first time using the software you get a message about no named ranges found, OK past this and when you see options hit “system tables”. This corresponds to worksheets in Excel. Select one worksheet (fields you want) and proceed until you get the option to go to MS Query. Then in MS Query hit the SQL button and amend the text from something like
Code:
SELECT field names
FROM source
to
Code:
SELECT field names
FROM source
UNION ALL
SELECT field names
FROM source_2
and continue to add for each additional table “UNION ALL SELECT field names FROM source_n”After finishing the SQL hit the open door button (or use the file menu) to end MS Query and then take the pivot table option at the next dialog box.”
I have tested it with as much as 10 sheets having 30K Rows X 8Col each and its amazing.
Yes, it can be done
P.S. : This was my first post and reason alone to join the lounge.
-
WSprasad
AskWoody LoungerJuly 3, 2009 at 3:22 am #1167446I am not sure whether I should re-open the topic but since it remain un-resolved(so far i am concerned), I take this liberty to do this. It took me almost a year or so (ofcourse I set the issue aside in between) to discover how to consolidate the multiple sheets in a single pivot table. Quote from the link provided by rory:
“It can be done entirely within Excel. Go via menu data, import external data, new database query. Excel files. OK. Select your file. If you don’t have defined names for the data the first time using the software you get a message about no named ranges found, OK past this and when you see options hit “system tables”. This corresponds to worksheets in Excel. Select one worksheet (fields you want) and proceed until you get the option to go to MS Query. Then in MS Query hit the SQL button and amend the text from something like
Code:
SELECT field names
FROM source
to
Code:
SELECT field names
FROM source
UNION ALL
SELECT field names
FROM source_2
and continue to add for each additional table “UNION ALL SELECT field names FROM source_n”After finishing the SQL hit the open door button (or use the file menu) to end MS Query and then take the pivot table option at the next dialog box.”
I have tested it with as much as 10 sheets having 30K Rows X 8Col each and its amazing.
Yes, it can be done
P.S. : This was my first post and reason alone to join the lounge.
Stuck…..
When i am adding new data source in edit query, displays a message ” file name is not valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long””.
Any idea????
-
WSsdckapr
AskWoody LoungerJuly 3, 2009 at 4:53 am #1167449Stuck…..
When i am adding new data source in edit query, displays a message ” file name is not valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long””.
Any idea????
Maybe I am stating the obvious, but it seems to me the message is indicating that the filename you are entering is invalid. Have you made sure that the name does not include invalid characters or punctuation and that it is not too long?
-
WSprasad
AskWoody LoungerJuly 3, 2009 at 5:14 am #1167452Maybe I am stating the obvious, but it seems to me the message is indicating that the filename you are entering is invalid. Have you made sure that the name does not include invalid characters or punctuation and that it is not too long?
Sure Steve, Name of first file is “Inv 300608” for which query is already set with desired results. I am trying to incorporate another file named “Inv 300908”. Earlier I have made a pivot table with 4 different files named “Inv 300607″,”Inv 300907″,”Inv 311207”, “Inv 310308”, sucessfully . I dont think there is anything wrong with name.
-
WSsdckapr
AskWoody LoungerJuly 3, 2009 at 6:06 am #1167454Sure Steve, Name of first file is “Inv 300608” for which query is already set with desired results. I am trying to incorporate another file named “Inv 300908”. Earlier I have made a pivot table with 4 different files named “Inv 300607″,”Inv 300907″,”Inv 311207”, “Inv 310308”, sucessfully . I dont think there is anything wrong with name.
But while you do not, it seems that Excel does. If you can do it with other names and only this causes the problem, it still seems to me that something is wrong with that name or the file with that name…
Steve
-
WSprasad
AskWoody LoungerJuly 3, 2009 at 6:27 am #1167455But while you do not, it seems that Excel does. If you can do it with other names and only this causes the problem, it still seems to me that something is wrong with that name or the file with that name…
Steve
I have already done the exercise to do it with different names without any success. I have changed the name of wb as weel as ws, but no results. What next???
-
WSprasad
AskWoody Lounger -
WSsdckapr
AskWoody Lounger -
WSprasad
AskWoody LoungerJuly 3, 2009 at 11:31 pm #1167552Try removing the “$” in the name…
Steve
No use of removing as excel put “$” in name by default and removing this cause invalid file name. I am not able to recognize the problem as it is doing well with other files with similar names /formats.
It is still worthwhile to use the function to consolidate multiple sheets to create pivot table irrespective of the fact that I am facing a problem like this.
-
WSHansV
AskWoody Lounger -
WSprasad
AskWoody Lounger -
WSHansV
AskWoody LoungerJuly 4, 2009 at 7:11 am #1167586The SQL statement in your screenshot will only work if the sheets are in the same workbook. If the sheets are in different workbooks, you have to provide the path and filename of each workbook:
SELECT …
FROM `C:ExcelBook1.xls`.`inv_3000608$` `inv_300608$`
UNION ALL
SELECT …
FROM `C:ExcelBook2.xls`.`inv_3000908$` `inv_300908$` -
WSprasad
AskWoody LoungerJuly 4, 2009 at 7:45 am #1167592The SQL statement in your screenshot will only work if the sheets are in the same workbook. If the sheets are in different workbooks, you have to provide the path and filename of each workbook:
SELECT …
FROM `C:ExcelBook1.xls`.`inv_3000608$` `inv_300608$`
UNION ALL
SELECT …
FROM `C:ExcelBook2.xls`.`inv_3000908$` `inv_300908$`is there a way to make excel understand to select entire path by default, as it select the file name only regardless to open/close wb?
-
WSHansV
AskWoody Lounger -
WSprasad
AskWoody Lounger -
WSHansV
AskWoody LoungerJuly 4, 2009 at 8:51 am #1167595You have already posted several attachments, so what is the problem?
You can use the PrintScreen key to place a copy of the screen on the clipboard.
Paste into Paint, then use the Paint tools to create an image that contains only the relevant part.
Save as a .jpg or .png file.Or attach a workbook with the relevant information.
See Adding Or Removing Attachments To/From A Post in our FAQ.
-
WSprasad
AskWoody LoungerJuly 6, 2009 at 1:00 am #1167752While setting query, it looks like this :
File used as database in closed and browse the same through dialogue box.
On editing the query, instead of displaying entire path, it displayes file name only.
I just want to know whether i should insert the path manually on editing or excel can pick it automatically?
-
WSHansV
AskWoody Lounger -
WSprasad
AskWoody Lounger -
WSHansV
AskWoody LoungerJuly 6, 2009 at 7:33 am #1167772You’ll have to use something like
Code:SELECT `inv_300608$`.`Inv-No`, `inv_300608$`.`Inv-Date`, ... FROM `E:PrasadSales TaxNMPLReturnAnnual Return8-09Inv-wise SalesQ1`.`inv_300608$` `inv_300608$`
Note:
– The consistent use of `
– The path and filename are specified only once.
– The extension .xls is omitted. -
WSprasad
AskWoody LoungerJuly 6, 2009 at 8:10 am #1167776You’ll have to use something like
Code:SELECT `inv_300608$`.`Inv-No`, `inv_300608$`.`Inv-Date`, ... FROM `E:PrasadSales TaxNMPLReturnAnnual Return8-09Inv-wise SalesQ1`.`inv_300608$` `inv_300608$`
Note:
– The consistent use of `
– The path and filename are specified only once.
– The extension .xls is omitted.Thanks Hans, very well doing with desired results.
-
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
4 hours, 12 minutes ago -
Sometimes I wonder about these bots
by
Susan Bradley
30 minutes ago -
Does windows update component store “self heal”?
by
Mike Cross
17 hours, 9 minutes ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
18 hours, 9 minutes ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
17 hours, 35 minutes ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
14 hours, 5 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
20 hours, 51 minutes ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
20 hours, 53 minutes ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
9 hours, 27 minutes ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
1 day, 5 hours ago -
0Patch, where to begin
by
cassel23
23 hours, 2 minutes ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
1 day, 18 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
1 day, 6 hours ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
2 days, 3 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
1 day, 18 hours ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
1 day, 5 hours ago -
Installer program can’t read my registry
by
Peobody
2 hours, 15 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
1 day, 15 hours ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
1 day, 23 hours ago -
False error message from eMClient
by
WSSebastian42
2 days, 14 hours ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
2 days, 23 hours ago -
Office 2021 Perpetual for Mac
by
rebop2020
3 days ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
3 hours, 10 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
3 days, 4 hours ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
11 hours, 33 minutes ago -
Outdated Laptop
by
jdamkeene
3 days, 9 hours ago -
Updating Keepass2Android
by
CBFPD-Chief115
3 days, 14 hours ago -
Another big Microsoft layoff
by
Charlie
3 days, 14 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
16 hours, 46 minutes ago -
May 2025 updates are out
by
Susan Bradley
1 minute ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.