How do I group date column headers by quarter, year etc - excel

I have an Excel sheet formatted as shown below that has sales data for various products in different locations
How can I create a pivot table that allows me to group the sales data by quarters or years?
There are examples where the date is not a column header but not for my situation
I have tried grouping but that is disabled. I also tried transposing the table so the dates are on the rows but that messes up the data.

Unpivot the date columns within Power Query. Select all date columns and then click Unpivot Columns from the Transform menu. Rename the resulting Attribute column as required.
You can now pivot the resulting table as desired.
Edit: if the number of date columns is not fixed, it will be better to select all columns apart from the date columns and choose 'Unpivot Other Columns'.

Related

How to order 'day, ddmmyyyy' format from old to new in pivot table?

I'm looking to create a overview of the planned maintenances for this year.
I have a maintenance worksheet where we put in the planned events, with a column where the dates are in the format of 'day, dd-mm-yyyy'. Since the format of the cells is 'date' in this exact format, I can use the filter to create an order based on the 'dd-mm-yyyy'. PRNTSC of source data
It becomes an issue when I want to create a pivot table. While using a pivot table gives good insights what type of different maintenance is done on a certain day PRNTSCR of pivot, the column can only be ordered in alphabetically. , although format of the column should is 'day, dd-mm-yyyy'
How do I format the column in the pivot table to be able to order chronologically?
Thanks!

Create a calculated pivot table column in excel based off other columns in the pivot table?

So I have a bunch of rows in a query table that shows orders from a certain timeframe and whether that order had a "defect" or not. I have started a pivot table on that table to summarize the # of orders and # of those orders that were defective by day (trying to start a p-chart).
Is there any way to create a 4th column in the pivot table that calculates the percent defective (Orders with Defects/Count of Orders) from the two existing columns?
Sure,
Based on this site, these are the steps:
To start, select any cell in the pivot table
Next, on the Excel Ribbon, go to the PivotTable Analyze tab
In the Calculations group, click Fields, Items, & Sets
Then, in the drop-down menu, click the Calculated Field command
Once there give a name to your Calculated Field and set your formula to Orders with defect / orders (tip: select the fields from the list to make sure you get the names right).
One last note: I believe calculated fields perform additions by default.. I noticed your 2nd column is a "count", I believe the calculated field will sum that column (before dividing) instead of counting it.

How do I filter a pivot table for MTD, QTD, and YTD?

I have a column full of specific date and time information, but I want use that data to filter my table to show only MTD, QTD, and YTD rows.
I can't upload an image of my table because of my work computer program, but I have the variable with the dates in the "report filter" field. The data in the column is given as an individual date and time, so that's all I can select when I try to filter it. There's too many option, and I need to be able to select simply QTD, MTD, or YTD dates. How can I do this? Apologies for the lack of imagery.
Select any part of the Pivot table
Under the Analyze tab of the ribbon select Insert Slicer or Insert Timeline whichever you prefer
Filter the dataset based on the criteria you want.
This won't give you your select columns, but without seeing the way you're data is structured should be a good fix.
If you have the issue where the dates won't summarize by month you can create two new columns to summarize the data and create a table with the following columns:
Month # / Month Name
1 January 'you can use whatever naming convention you prefer (jan, etc.)
2 February
....
Then you want to use the MONTH function combined with a VLOOKUP. It should look like =vlookup(month( [date cell reference]), [table you just made], 2, 0) This will pull the month name. Then you can use the YEAR function to get the years. Then make sure the pivot table accounts to the adjusted range and pull those in instead of date. You can still use the slicer and timeline to filter out the dates, but it will be summarized based on these new labels.

Excel 2016 Pivot Table Sorting Dates Alphabetically

This probably wouldn't count as a programming question, but I'm starting to think it might be a glitch with Microsoft Excel 2016.
My Pivot Table aren't sorting my dates chronologically.
When I toggle the 'Sort Oldest to Newest' in the pivot table, my dates seem to be sorted alphabetically.
Date Revenue
10-Aug $83,004
10-Nov $43,137
10-Oct $881,775
10-Sep $470,486
11-Aug $45,676
11-Nov $250,890
11-Oct $1,324,366
My source data is sorted chronologically no problem.
Source Data sorted nicely:
I have confirmed that my source dates are formatted as Date as well as the format in pivot table. However, I should note, that I can't seem to change the format of the dates on the pivot table. I've Tried the Following:
Opening the 'Value Field Settings Box' by right clicking on the 'Date' field in the Rows > Opening the Format Cells by clicking on 'Number Format' > Selecting Date (and changing the settings from 'd-month' }} This doesn't change the formatting
Highlighting the date column and changing the format to short date in the Number Section of the Home Ribbon }} this also doesn't change the format of the date
In order to confirm that my dates in my source information are formatted as dates, I used the 'Text to Columns' function to be sure that all the dates were pasted as mdy dates. I've also selected the column of dates and right clicked to access format cells as dates. Lastly, I ensured that they registered as dates according to the Number column in the home ribbon.
I thought this was a simple problem, I want my dates in my pivot table to sort chronologically, but it seems to be impossible.
Here is a link to the file for reference.

How can I create a % variance column in Excel 2010 pivot table?

I have a Pivot table containing sales data.
In the Rows I have sales country, in the Columns I have sales date (year) and I have the sum of the invoiced net values in the data section.
Across the top I have two columns - '2012' and '2013' - next to these excel, by default adds a grand total column adding the two years together.
Is there anyway that, instead of a grand total, I can show the percentage variance between 2012 and 2013?
Excel 2010 may be different but if Excel 2007 is better than nothing:
Create your PT in the normal way (Country for Row Labels, Year for Column Labels, Sum of Invoiced for Σ Values).
If present, remove the Grand Totals for rows (Select the PT, Pivot Table Options…, Totals & Filters, uncheck Show grand totals for rows). The Grand Totals for columns may be kept, but the value there in a column to be added would not be meaningful.
Select a column header (say 2013) and in Options > Tools – Formulas select Calculated Item…
In Name: select something suitable (perhaps ΔYonY) and for Formula: enter =('2013' -'2012' )/'2012'.
Set font colour of bottom right-hand cell to match fill.
pnuts' answer is accurate.
If you are looking for a way to have this calculated automatically in the PivotTable, you can use calculated fields.
In order for this option to work, you will likely have to change the way your data is structured.
I'm assuming right now you have a data column with Sales Date. You will need to add one column per year, and assign a value to it in your data. You can then get rid of your invoice column.
Click anywhere inside your pivot table, in the ribbon go to Fields Items & Sets, Calculated field.
In the formula, type in what you need (you can use the fields list to add them in). I did =('2013'-'2012')/'2012'
You can then of course change the formatting to be in %
See screenshot for old vs proposed.

Resources