Issues grouping in excel? - excel

I'm having a little bit of trouble grouping dates in excel. I have created a pivot table that groups a bunch of dates between 3 months together. However, I want to take advantage of the refresh ability of pivot tables--the idea in which when you refresh your pivot table, it will update to whatever you added or took away from the source of data your pivot table is based on.
However, when I grouped the dates between three months together, I noticed if I don't add a date that exactly corresponds to the dates within the grouping, the picot table does not add that entry into the pivot table. For example, if my grouping had the following dates (between May and July) in it:
5/21/2013, 7/18/2013, 6/8/2013
And in my source data spreadsheet had the following date added to it:
5/2/2013
5/2/2013 would not be added to that specific grouping in the pivot table because it is not exactly like the other dates as stated above. I want it so that I can group all dates from 5/1/2013 to 7/31/2013 inclusively as opposed to the dates in the original grouping. Would anyone have an idea on how to do so? Thanks!

http://www.datawright.com.au/excel_resources/expanding_pivot_tables.htm
im curious as to how you are currently grouping them without adding new ones, there may be a way to work with what you already have especially if you are willing to incorporate some VBA

Provided your source 'dates' are not text Excel should be able to cope.
I fear (hope?) we were at cross-purposes about which "Group" to use. I meant the one that pops up (as on the left below) when right-clicking one of the Qtr headings in the PivotTable.

If you have access to add additional formulas in the data you could just calculate "quarter" in an additional column (reference here)
How can I obtain the year quarter from a date?
I tend to always make my groups in the rows of data like this, rather than attempt it using pivot groups. For example, you might also extract "year" with = year(A1) in the rows - so you can easily add it as a pivot row item later for grouping. If your data source is properly formatted as an excel 2007 "table" these kind of formulas will fill themselves downward when you paste new data.

Related

Find, Sum, and Remove Duplicates in 3 different subsets of data in a spreadsheet

I have a spreadsheet that contains truck load data. The spreadsheet contains each portion of the delivery cycle; Month-Year, Supplier(VDH_Columns) to Vendor Pickup(VPK_Columns) to Receiver(CUST_Columns) and Tons delivered(Tons). If the Vendor Pickup Columns are populated, the cycle goes VPK to CUST. If the Vendor Pickup Columns are not populated, the cycle goes VDH to CUST.
I want to maintain the spreadsheet exactly how it is and not make a CUST sheet, VPK Sheet, and VDH Sheet.
The ultimate goal is to have 1 Month_Year for each Receiver(CUST) and sum either the VDH or the VPK. Below is a piece of the spreadsheet(What it looks like now) and I manually created what I want it to look like.Spreadsheet Example
I tried a pivot table with a Month_Year filter but the problem is that I can't see once I try to add all the other columns it becomes so busy that I end up quitting. I've thought about Consolidate but I have no experience with that. I'm assuming VBA code would be able to accomplish it but I have no experience there either.
Thanks for any help
A Pivot Table is the way to do this. You need to drag all of your columns to the "Rows" field, and then drag the Tons column to Values. It should automatically use a SUM summarization:
Then, you would select a Tabular layout from the Design tab.
This will give you the desired output:
You can get rid of the (blank) values by using Conditional Formatting on the Pivot Table. Use custom number format ;;;

Adding slicers for both the rows and columns in a Pivot chart

I work with this data:
link to screenshot
The goal is to create a (bar) chart where I can choose both which week (01, 02, etc.) and which column (sleep, exercise, etc.) it displays. While adding a slicer for Weeks solves a part of that problem, I cannot seem to find a way to add a slicer for the column categories. I can add a slicer for a particular column category, like Sleep, but that only gives me the option to choose from different numbers for each week inside the table.
Although I realize this could be fixed by simply removing unwanted/adding wanted fields inside the Pivot table, it's not particularly feasible because the end goal is to have a dashboard where one can easily make a selection of different criteria for data filtering. Below is a screenshot of what I'd like the end result to look like, excpept that there'd be an additional slicer that allows me choose which column data I wanted displayed.
Approximate example of desired end result

Excel Dynamic Array Spill Area - can it go along a row or just down a column?

The point of this exercise is to try to make this analysis quicker/easier to update. I had it pretty dialed in using a data tab and a pivot table, copying and pasting values/formulas as needed to update. I am trying to improve on that by using Excel's new Dynamic Arrays.
My table is setup with four employee detail columns (Location Name, Location Number, Employee Name, Employee Number), and several (many) columns for dates worked. My issue is the dates worked.
I am using UNIQUE and FILTER to get a list of flagged employees - works as I intended/hoped; lookup formulas to find the location name and number data for each employee from the data table - works as I intended/hoped; and I have been copying/pasting the dates from the pivot table column headers into my "counting"/analysis table header.
What I would like to do is use the UNIQUE formula to get the dates worked - BUT, I want the spill area to go along the row so the dates are column headers. Okay, I probably could have made that a shorter ask, but I hope explaining a little of what I'm trying to do helps. I want the dates to automatically update when I paste new payroll/hours worked data into the data table, the same way the employee data updates.
The key is to TRANSPOSE the UNIQUE formula, not the data:
=TRANSPOSE(UNIQUE(A1:A9))
I cannot find anything about having the spill area go along a row instead of down a column. My workaround for this was to create a column of unique dates next to my data table. Since the data is in a table, the unique dates will update automatically when the table is updated. I used the Offset formula to pull the dates into my column headers from the column of Unique dates next to my data table. I will say, while this setup is easier than updating via the pivot table, it is a formula heavy workbook now.
For the data headers I used : "=OFFSET('Data Table Tab'!$U1,Column()-5,0)". The "rows to offset" portion of the formula is "Column()-5". My first date header is in column 5, so as it is copied to the right this will increment the number of rows to offset from the first date.
At this point I will just need to copy the formulas over to the right to update my analysis table.
I would be surprised if someone else out there just starting to work with the new Dynamic Array formulas in Excel doesn't wonder about the same thing. If you stumble across this question and have a better solution, please feel free to share it with me.

Ignore tier 1 rows in Excel pivot tables

I have a pivot table in Excel, and I'm trying to do some calculations on the results. This is all fine and good, but I'm running into a problem due to the grouping of a pivot table.
I have a dataset indicating transaction history for a particular client/patient at a vet clinic. These are reflected by clientID and patient name in my pivot table. I've used a pivot table to group by client then patient to see when the first purchase was made and how many total purchases there have been. I want to then do a calculation on that for each patient.
My problem is here. Excel has all the data for each client grouped in what I'll call "tier 1 results". The only data I want to do the calculation on are the "tier 2 results". These are row 7 and then rows 8-9 in the screenshot below.
In effect, I wan to include something in the equation in column F to ignore any bold text, but Excel doesn't appear to be able to do this. VBA is an obvious solution for me, but I'm creating steps for salespeople to use to analyze the data while they're out in the field. We need to keep things as simple as possible. Copying and pasting an in-cell equation is one thing, but using VBA is way over their heads.
Any thoughts on how to ignore the tier 1 results?
Your pivot table uses compact form layout, where all the groupings appear in one column. You can change that to tabular form to have each group level in its own column. The screenshot shows the difference:
Click a cell in the pivot table and then Pivot table Design ribbon > Report Layout dropdown > Tabular form. There are other settings to get rid of subtotal rows, etc.
Now you can build formulas that take into account only the level that you require. (It is also possible to repeat the pivot group labels for each group level where there are blanks.)

How do I filter dates by a cell formula in an Excel pivot table?

I am attempting to make some reports in Excel using a pivot table of a Sql server view. One of the customer requirements is to be able to filter the reports based on a date range they select, which seems reasonable. The end user process needs to be fairly simple, so my preference is to have a cell for begin date and one for end date and allow the user to
enter these and refresh the table.
There are two problems which I haven't been able to get past:
Selecting a date filter doesn't appear to provide any way for me to reference a cell as a source for the value. I have to put it in at the time.
It seems as if it is only possible to define a date range if I am grouping on the date field. For some of the reports, this violates the specification. The Report Filter section of a pivot table only seems to allow me to filter by individual values rather than a range. This gets unmanageable on real data which might have hundreds of dates to go through.
One thing I have tried is to create an intermediate table without any aggregates columns in a separate sheet in the same workbook, and then filter that. This hid the columns correctly in that intermediate table, but had no effect on the pivot table which derived from it.
Does anyone have ideas for how I can make this work? It seems like a fairly obvious use case - is there something I am missing about how pivot tables are supposed to be used?
The easies thing you can do is changing your pivot table query on the fly.
When the source cell is changed (Worksheet_Changed event), append " AND WhateverDate > '1/1/1111'" to Me.PivotTables("Your pivot").PivotCache.CommandText and refresh the pivot.
I remember I solved a similar requirement some years ago by making the SQL query dynamic (i. e. putting it together as a string in VBA, and using the cells with the range values in the where condition). ant the VBA macor was then called with a button labeled "refresh".
But I am sorry do not have this code available any more, I just remember the general idea.
This has been dead for a while, but I thought I would post a different method. add a formula to the source table that returns a '1' for thing you want, and a '0' for things you don't, and then add a filter in the pivot table that filters only the '1'.

Resources