Grouping by Date in a Pivot table from Multiple Consolidation

bjkaddy

New Member
Joined
Mar 4, 2013
Messages
4
Hi All,
I have used multiple consolidation ranges from 4 tabs to 1 pivot table that have data pulling from 4 connections. From this Multiple consolidation ranges pivot table I am trying to group a date column however when I try to do this it will not give me the option to select Days, years, quarter, etc. It will just group everything into "Group 1".
I have seen online that this could be happening do to blank cells?
Any help/workarounds would be great.

Thanks in advance,

Bjorn
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi Bjorn and Welcome to the Board,

As far as I know Excel won't let you group a field by dates if there are blanks, text or other non-date values in that field.

If you have blanks, can you fill them in with a dummy value like 1/1/1980?
If you are grouping by date, which group would you want the blanks to fall into?
 
Upvote 0
Hi Jerry ,
thanks for the response and the welcome. I tried putting in a dummy date 1/1/1900 and it still would not let me group by date. I thought it may be due to the fact that there were other blanks in the other non-date columns. I then proceeded to Find Replace blanks with zeros. To no avail, still didn't work. I am thinking it has something to do with using the Multiple consolidation function and messing up the Pivot table fields. I.E. In the one field drop down there are numeric value and character values. I have heard from Excelisfun's Facebook page that I could consolidate my 4 connections using power pivot to circumvent the problem(the real problem). However I can't download power pivot due to the fact I have excel 2007. It's vicious cycle. :)
 
Upvote 0
Bjorn, I don't use the built-in consolidation feature and I found that I had the same problem in trying to get group by dates to work when using that method.

A better approach would be to use the results of a query as your data source. PowerPivot makes this easy to do, however you can do it almost as easily with xl2007 using MSQuery.

Fazza has many threads on this site that describe how to use MS Query to consolidate multiple data sources for PivotTables.

Here's a link you could use as a guide.

http://www.mrexcel.com/forum/excel-questions/315768-creating-pivot-table-multiple-sheets.html

Fazza's instructions are based on xl2003. The steps are very similar in xl2007-xl2010. Just ask if you get stuck.
 
Upvote 0
Hey Jerry,
Thanks for the reference to the other post. I am stuck on a few things.
-I am struggling to find a download for MS query.
-Per Fazza's instructions it looks like I need to get my data into access and then pull it back into excel via MS query? Or do I just need MS query to merge these connections?

If the first is true how do I import my excel connections to Access.
Sorry, I am new to the Access/Excel crossover. I have used the import wizard in Access and have used the duplicate record detection but that is about it.

Bjorn
 
Upvote 0
Hi Bjorn,

MS Query can be used directly from Excel without any use of Access.

Below are some instructions on how to use MSQuery to create a data source for one or more PivotTables using xl2010 or xl2007.

The Data Ranges to be consolidated must be have the exact same headers in the same order.
These instructions assume they are on separate sheets of the same workbook.
The titles in blue font below represent the titles of the dialog windows that you'll see as you proceed.

Define Named Ranges:
Define a separate Named Range for each Data Range to be consolidated.
This example assumes they are named MyDataA, MyDataB, MyDataC, and MyDataD.
Include the header row when selecting the range.
The Named Range must reference a fixed range (may not be a Dynamic Named Range).

Save and Close the Workbook

Open a NEW blank workbook

Launch the PivotTable Wizard:
Click on any sheet then key: Alt-D then P

PivotTable and PivotChart Wizard Step 1 of 3
Select External data source, PivotTable > Next

PivotTable and PivotChart Wizard Step 2 of 3
Click Get Data...

Choose Data Source
Excel Files* > OK > (Browse to your file with the 4 named ranges and select it) > OK

Query Wizard - Choose Columns:
Select the Name "MyDataA" then click the ">" button to select its fields
Next >

Query Wizard - Filter Data:
Click the cancel button to short cut wizard steps that are not needed
You'll see a prompt "Do you wan to continue editing this query in Microsoft Query?
Click Yes

A Microsoft Query Window will open
Click on the menubar button labeled "SQL"

Copy and Paste this text into the SQL statement: box (replacing the existing statement).

SELECT * FROM MyDataA
UNION ALL
SELECT * FROM MyDataB
UNION ALL
SELECT * FROM MyDataC
UNION ALL
SELECT * FROM MyDataD


You'll see a prompt: "SQL Query can't be represented graphically. Continue anyway?
Click OK
Click on the menubar button with the Exit Door and arrow

PivotTable and PivotChart Wizard Step 2 of 3
Click Next

PivotTable and PivotChart Wizard Step 3 of 3
New Worksheet > Finish

You should now have a PivotTable started in a new worksheet.
Set up your PivotTable report using the PivotTable Field List just as you would if you had a single range as your data source.

If you want, you can move your PivotTable into the same workbook as the source data.
When your source data changes, simply refresh your PivotTable and it will be updated.
If you add or delete rows from your source data, make sure that your named ranges are adjusted to the size of the new dataset.

That's it! There are a lot of steps, but after doing it a few times it's easy to remember the process. :)
 
Last edited:
Upvote 0
Hey Jerry,
That worked great and was very easy to follow. Thanks so much for your time and for responding so quick to this post.
It is awesome having great people who post on sites like these.

Thanks again!

Bjorn
 
Upvote 0
Hi...

PivotTable and PivotChart Wizard Step 1 of 3- Why do we need to open a separate workbook for this ?

Cant we do it in the same workbook where all the datas are available.

Am asking this just out of curiosity,nothing else.

Thanks
 
Upvote 0
Hi Chaand,

MS Query returns an error if you try to reference an open workbook while using that interface.

If you want, you can move your PivotTable into the same workbook as the source data after the query has been set up.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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