Convert Excel table based on Column Values using VBA - excel

Have this Table below ,
I would Like to use the Header Column to transform the Table like this
Any Help It will be great, Best regards
Hala

You can easily solve this puzzle with a pivot table. Put the amount field into the values section of the pivot and set to get sums. Put the header field into the columns section of the pivot. And put the rest fields into the rows section of the pivot. Pivot will auto-show the grandtotal and subtotals per rows but you can remove them easily with a right click on it. And finally to get a view like a data table click repeat all item labels in pivot's report layout.

Related

Sum in columns, subtraction in grand totals - DAX

I would like to see the sum of data in columns and subtraction in grand totals in an Excel pivot table based on Power Pivot, e.g. in the column "Suma końcowa" I would like to see subtraction A-B instead of sum.
Thanks for help!
file
table
Here you go for a option of pivot from table of data.
The fields which you have in the tables will converted as grouped for same Column when makes pivot table.
Hence the calculated Item doesn't work. So added "Month" Column by Using Formula of =Text(value,"MMM'YY"). The created the pivot table and done manual calculation.
1.Added Month Column In Table :
2.Crating new pivot table based the Table data:
3.Pivot Table Created and Filed assigned based on required format:
4.Insert Calculated Item From analyze Tab:
5.Working on calculation Item option:
In The Insert Calculated Item View Type Name manually as
what you need the field header ex. Subs
The In The Formula Tab Type = (A-B) else double click on the
A field and the type "-" manually then double click on B
Then Click Add then the field "Subs" will be added In Pivot Table.
6."Subs" Field added in pivot and removing Grand Total From Pivot Table:
7.Final view of Pivot with "Subs" field from table of Raw Data:
Note: Please read complete and view the images to understand better
way. The adding filed
item not possible by making your own pivot style which is in your question image,
due to the Data filed is in Group option.
So need to follow the steps which i have mentioned over above.
Please let know though comments if need any more clarification.

Combining Column Values in an Excel Pivot Table

In order to simplify a stacked bar chart, I am looking to sum up the counts of multiple columns I have in my pivot table. For example, in this sample table, I would like to combine Fruits and Vegetables into one column, so that each bar will comprised of three colors: one for Meats, one for Grains, and one for Fruits+Vegetables.
Pivot Table and Stacked Chart
For reference, this is the data source:
Data Source table
I tried adding a Calculated Field, but I'm not sure if I can use specific values from a column in the Formulas field. Is there a way to create something like this from a pivot table, or should I be taking a different approach to this all together?
I'm using Excel 2016, -- pretty sure it's the same with older versions, but the premise is the same.
In your pivot table, Select the Pivot Table Tools> Analyze tab, then "Fields, Items",then pull down to"Calculated fields". Enter a name for the generated field, and the formula you want to use:
In my example, I added the fields Fruit and Vegi's from my available pivot table fields (which is based on my data table).
Then select the calculated field as you would any other..
and create the chart as usual.
Hope this helps.

Excel Pivot Table - How to retrieve value of cell in Rows section

I have some raw data as shown below.
I created a Pivot Table for it, mainly just for formatting purposes (the ability to nicely group and expand the sub-items). The Pivot Table is shown below.
I need to display the LastUsageTime for each of the items (UsageName) listed in the Pivot Table. It is simply a lookup of the LastUsageTime column from the Raw Data.
From my research so far, it looks like I have to use Index+Match to do the lookup to match all 3 columns (TPC, TeamProjectName, UsageName). Something like:
{=INDEX('Raw Data'!A2:E2000,MATCH(1,('Raw Data'!A2:A2000=???????)*('Raw Data'!B2:B2000=??????)*('Raw Data'!C2:C2000=A6),0),5)}
However, I don't know what to use to retrieve the TPC and TeamProjectName of each UsageName in the Pivot Table.
I hope this makes sense, and thanks for any help!
For the sake of an answer:
Process your LastUsedTime data into what is recognised by Excel as Date/Time and then add a field to your PivotTable for Σ VALUES Max of LastUsageTime (or Max of ... whatever the column of adjusted LastUsageTime data is labelled).

Create a calculated field using values to create a slicer in excel pivot table

I have a data set where one column (job type) has 4 values in it (A,B,C,D). I am using that column as a slicer in a pivot table. However I would like to modify this slicer to only have two options (X,Y) where X=A+B and Y=C+D. I know I could create a new column in the raw data but I am trying to avoid this as the raw data source is already highly manipulated through several dozen high complexity mods.
Apologies if this isn't clear!
This is tested on Excel 2010.
I'm assuming that you have your pivot table setup with the items you want to slice as the row labels.
Select the "A" label, ctrl click the "B" label, and then right click, selecting "Group". Do the same thing for the "C" and "D" entries. You will notice a new field in the Field List and in the Row Labels section.
Clean up by changing the name of the new label, and the new groups.
Drag it out of the Row Labels area. Your pivot table should look like it did before, but with a new field available. Insert a slicer, using that field as the selection field.
Have a look at a quick video I made here: http://youtu.be/QIcZPGxisKM

Excel 2007 Pivot Tables Custom calculation?

Again I'm wrestling with Excel 2007! I have some data I'm using to generate a Pivot Table and I'd like to divide all of the data by 1000...
I know I could go in and change the original data by hand but I'd much rather have a formula in the Pivot table itself that does this for me.
Any thoughts?
ps: You guys are awesome!
Create your pivot table, then in the Pivot Table options select Formulas/Insert Calculated Field. Assuming your data field is named MonthlySum then the formulat would be =MonthlySum/1000. Change the name of the Calculated Field as desired. The newly named calculated field will now be available to add to the values in your Pivot Table. As a side note you cannot use calculated fields as row labels.

Resources