Pivot Tables & Formula: Build A Pivottable And Let Users Move The Fields Around

Apr 28, 2007

I'm trying to do at the moment is build a user interface for some Excel Data. Now, the natural way to do this would be to build a pivottable and let users move the fields around, and this is how the thing has worked in previous iterations of the workbook. It seems now, hoever, that we're trying to cater for users for whom pivot tables are just a little too much and to summaries data based on listboxes etc.

What I'm interested in knowing is whether there are ways of interacting with PivotTables beyond the GETPIVOTDATA function - is there any way, for example, to select different field items to show based upon an input from elsewhere? How does one tell a pivottable what to do from outside the pivottable?

View 3 Replies


ADVERTISEMENT

Pivot Tables - Create New Fields On The Fly?

Feb 1, 2010

it's possible to create new fields (variables/columns) on the fly (without adding them to the original data table).

For this example, assume I have a column for:
job code estimated hours
job code actual hours
total estimated hours
total actual hours

Excel has made it easy to run averages or sums for any of those columns, but what if I want to see what the average proportion for job code estimated hours/ total estimated hours? Is there an easy way to do it with pivot tables without adding a column to my database? I'm working in Excel 2007, my data table size is approximately 100 columns by 200 rows.

View 2 Replies View Related

Calculated Fields In Pivot Tables

Dec 5, 2006

My Pivot Table data section contains calculated fields and normal fields...both have sub and grand totals. The calculated items are correct but. the calculated field totals are incorrect. The normal field totals are correct. The calculated field totals are ... the True total multiplied by the number of items!

View 2 Replies View Related

Pivot Tables - Calculations Based On The Fields?

Jan 16, 2014

I am just starting to use the wonderful pivot tables.

I have a long list of data which basically consists of the following info:

-Company Code
-Country
-Account description
-Account balances

The pivot table is set up like so:

Row labels - Company Code, then Country

Column Labels - Account description, eg Input Tax, Output tax, clearing account, import tax, acquisition tax, set off account
Values - Account Balance

The table works perfectly.

Now what I want to do is some calculations based on the fields

- a check that Acquisition tax = the negative of the set off account, (i.e net to nil)

- a sum of the balances in the import, input and output tax accounts

- a comparison of that last figure against that in the clearing account to identify a difference

I tried to do it using basic formulae but I can't drag and drop the formula down the rows.

And I couldn't make out what the calculated cell function does. It appears to only include the titles of my data and not the individual fields.

View 1 Replies View Related

Linking Pivot Tables - Multiple Page Fields

Feb 16, 2010

I have two pivot tables on one sheet and I want the page fields on the second to change when I change the first pivot table. I found the below code and have applied it to one of the three page fields I have, but can't seem to duplicate it for the other page fields:

View 7 Replies View Related

Pivot Tables And Counting True Fields For Two Columns

Feb 26, 2009

I have just started using pivot tables and I have ran into a problem with the count feature. I have an original data list that breaks down in the pivot table to:

date
events on that date

Using the pivot table facilities, I want to do a count of those who said they were going to attend, and those who actually attended. The detailing both of these columns on the original list have a true false designation. When I do the count, the summarised information only counts the number of records for each of these events, and not the 'true' field entries for each of these columns.

How do I count these two parameters for 'true' from the original list in the pivot table so I can see a comparison between these two numbers?

View 9 Replies View Related

Unhide All PivotTable Fields

Jan 11, 2008

In a pivot table the user is able to select multiple entities to hide in the 'Hide Items' field of the PivotTable Fields window. I would like to create a macro (or edit a macro in the VB Editor) that willl reset all 'Hide Items' in the PivotTable Fields window...effectively unselecting any previously hidden entities.

View 2 Replies View Related

Link PivotTable Page Fields

Nov 20, 2006

I have a workbook with three sheets. The first is a list of employees with their managers. The second is the data about those employees (who they sold product to, and how much, on what date). The third is the PivotTable with the employees' sales. I have the Customer name in the Row field, and the amount in the Data field. I have two page fields - the Manager's name and the Employee's name. The example that I'm using so as not to violate my NDA is a Northwind knockoff. That's why the names probably sound familiar.

What I want to do is have the second pivottable page field (Employee) change, so that when I choose a manager's name, only the employees who report to that manager show up in that page field. I have a named range called "allEmp" (all employees), one called "buchanan" (all the employees who report to Steven Buchanan), one called "fuller" (all the employees who report to Andrew Fuller). (File attached, btw).

Private Sub Worksheet_Calculate()
Dim mgrRange As Range
mgrRange = Range("allEmp")
Range("$b$1").Select
Select Case ActiveCell.Value
Case "Andrew Fuller"
ActiveWorkbook.PivotTable("EmpSales").PivotFields("Employee").CurrentPage = Range("fuller")
Case "Steven Buchanan"
ActiveWorkbook.PivotTable("EmpSales").PivotFields("Employee").CurrentPage = Range("buchanan")
Case "Susan Erickson"................

View 6 Replies View Related

Unable To Drag PivotTable Fields

Aug 27, 2007

The issue is that for every pivot table in any file running on my machine, I am unable to drag the column or row values to change the sort order - I.e. if the row is Jan/Feb/Mar/etc., I can't drag Jan down to the middle or rearrange them - it will sort by ascending or descending value just fine, but simply won't allow me to rearrange - the 4-way arrow doesn't appear where it should when mousing over the fields. I can drag fields on/off and from/to the column/row/data sum areas, but I simply cannot re-arrange the order of the values (and yes, the Autosort checkbox is set to "manual" in field settings.)

View 7 Replies View Related

Group & Hide PivotTable Details Of Certain Fields

Oct 8, 2008

I have a pivot which under a Main product, there are a few sub products. I have act, budget, forecast etc figures but mainly want to only show the Total Act and not the rest, see the highlighted brown columns which I do not want to show in the pivot.

Then I want to group the clients, salesperson together so that the details can be hidden.

This is a small example. I have a large pivot table with lots of teams and salespeople and clients and a few main products with a few sub products within it. Grouping it manually is going to be very difficult and would appreciate if there is some way to automate it either via pivot capability or VBA.

View 4 Replies View Related

Using References In Pivot Table Calculated Fields Formula

May 23, 2007

Worksheet A contains two columns, that maps individual operations to their unitary cost:
COLUMN 1 = a list of operations
COLUMN 2 = the cost associated with each operation.

I can do a vlookup on this worksheet to retrieve the cost of each individual operation.

On another worksheet, I have a pivot table with a field that produces the sum of operations performed by type of operation, eg.

operation 1 was performed 5 times
operation 2 was performed 7 times
operation 3 was performed 4 times

I want to add a calculated field in the pivottable, that would output the total cost per operation. The formula for the calculated field in thepivot table would be
= operation * vlookup("name of operation","range for lookup table",2,0)

... unfortunately, "references, names and arrays are not supported in pivottable formulas".

View 9 Replies View Related

Formula: Keep It In A Cell And Rather Not Get Into Pivot Tables

Jun 2, 2008

I like to keep it in a cell and rather not get into pivot tables.

I don't know if it can be done but I need two formulas that are described below. I am thinking maybe an array formula? ....

View 14 Replies View Related

Control Multiple Pivot Tables With Formula?

Oct 25, 2011

I have 3 different pivot tables (with 3 different data sources) on 3 seperate sheets (sheet2, sheet3 & sheet4). Each pivot table has a report filter which contains employees names. On sheet 1 I have a sort of 'dashboard' set up feeding from the data in the pivot tables, and a combo box form control from which I can select the employees names.

Currently, if I want to see John's data, I need to go to Sheet1 and select 'John' from the report filter, then goto Sheet2 and select 'John' from the report filter & the same for Sheet 3. I was wondering if it is possible to somehow link the pivot tables to the combo box - so that when I select 'John' from the combo box on Sheet1, it automatically selects 'John' in the report filters on sheets 2,3, & 4.

View 9 Replies View Related

Convert Column Data Fields To Row Data Fields In Pivot Table

Feb 8, 2014

CountryHourDataTotalData
Austria - A10Sum of SeiA51CountryHourSum of SeiASum of SeiT
Sum of SeiT4.88Austria - A10514.88
1Sum of SeiA561562.83

[Code]....

left side pivot created in vb 6.0 & right side pivot table created manually in excel.

i want to generated pivot table using vb 6.0 same as right side pivot.

Set PRange = ws1.Range("R1:Y" & finalrow)
Set PTCache = wb.PivotCaches.Add(SourceType:=xlDatabase, SourceData:=PRange)
Set PT = PTCache.CreatePivotTable(TableDestination:=ws2.Cells(1, 1),

[Code]....

View 2 Replies View Related

Adjust Column Label Selection Multiple Pivot Tables Based On One Pivot Table

Aug 16, 2013

I have a pivot table in the first sheet which includes the field "Date" as a column label.

In the remaining sheets, except for one, there are pivot tables based on the same underlying dataset which also include the field "Date" as a column label.

I would like to adjust the selection (i.e., exclude some dates) from the column label in the first sheet and see if it is possible to make the same adjustments automatically to the pivot tables in the remaining sheets as well.

note that the field "Date" is used as a Column label, i.e., it is not a Report filter.

View 3 Replies View Related

Change Pivot Source Data In Multiple Pivot Tables?

Jan 21, 2013

I have a single workbook with multiple worksheets. Each worksheet has a different pivot table displaying a different view of the data. Each pivot table uses the same source data at worksheet1.

Each week i add new data to the end of the source data, which means that I need change the source data reference separately in each pivot table to update each pivot table view to include the new data. This is laborious as there are quite a few pivot tables.

Was wondering if there is some way of changing the pivot table source data reference on all pivot tables at the same time.

View 4 Replies View Related

Count Pivot Fields In Pivot Table

May 2, 2007

I am trying to find a way to count the total number of pivot fields in a pivot table so I can remove ghost pivot items that are no longer in the pivot table data. My code for this subroutine is as follows;

Sub RemoveGhostPivotItems()
Dim ghost As PivotItem
Dim pt As PivotTable
Set pt = ActiveSheet.PivotTables(1)
pt.ManualUpdate = True
For Count = 1 To 10
On Error Resume Next
For Each ghost In pt.PivotFields(Count).PivotItems
ghost.Delete
Next ghost
Next Count
pt.ManualUpdate = False
End Sub

My code makes an assumption that I have 10 Pivot Fields or less. It would be nice to actually know the number of Pivot Fields so my "For Count" Loop would be more efficient. In otherwords;..............

View 2 Replies View Related

Refresh Pivot Tables Linked To Pivot Table

Jul 25, 2006

I currently have several pivot table that's linked to a single pivot table(let's call it X) in the same workbook. I'm doing this to limit the file size because the data in X comes from a text file that has millions of lines. However, it's such a pain every time I need to update the tables because simply clicking "refresh" does not update those tables that are linked to X with new data. I would have to instruct the wizard in every linked table to point to X every time. I'm trying to write a small program to re-point to X for each of those other pivot tables whenever i refresh data. However, after trying to record the steps to do this I'm still unable to run these

Sub Macro1()

ActiveSheet.PivotTableWizard SourceType:=xlPivotTable, SourceData:= _
"PivotTable1"

End Sub

View 6 Replies View Related

Pivot Table Based Off Multiple Pivot Tables

Sep 5, 2006

Is it possible to create pivot table from another multiple pivot table.

Example: I have two diff pivot table "Income" and "Expense" as well
and I need to preapare new pivot table using with those two pivot table

View 3 Replies View Related

PivotTable Code: The PivotTable Field Name Is Not Valid

Aug 3, 2007

The code I'm using that results in the following error message: "Run-Time Error '1004':

The pivotTable field name is not valid. To create a pivottable report, you must use data that is organized as a list with labeled columns. If you are changing the name of a pivottable field, you must type a new name for the field." Here's the code, I've seperated it into each sub hoping that will make it easier to read:

Option Explicit

Sub main_prog()
Call td_metrics_import
Call pt_td_metrics("Pivot_Page1", "PivotTable1", "PivotTable2")
Call pt_td_metrics("Pivot_Page2", "PivotTable3", "PivotTable4")
Call create_graph
End Sub...............

View 8 Replies View Related

Can Pivot Table Be Created From Several Other Pivot Tables

Mar 5, 2014

I have 12 months worth of data in twelve separate workbooks each with a pivot table, I have copy/moved the pivot table tab from each into one workbook so now I have a workbook that consists of 12 tabs each with a pivot table. What I would like to be able to do is create a summary table with the full years data; where I am running into problems is that each months table has slightly different row and column counts and labels making any formula like =sum([sheet 1 cell a1]+[sheet 2 cell a1]) problematic.

View 3 Replies View Related

Pivot Tables: Pivot Table Layout

Oct 14, 2003

if there is a way to display a table as column percentages but have the totals as raw numbers.

View 9 Replies View Related

Show All Pivot Items In Pivot Tables

Jun 19, 2008

I've got 4 pivot tables (all derived from the same base data) on 4 separate worksheets. I've been able to (with this help of this site) to use VBA to hide pivot items on all of these sheets using a list on a user form. Hide/Show Pivot Table Field Items. Hide Pivot Table Fields Pivot Items by Criteria

I now need to be able to show all the pivot items on only 3 of the 4 pivot tables, with the 4th pivot table being left untouched. For ease assume that my sheets are sheet1, sheet2, sheet3, and sheet4. The tables I wish to update are on sheet2, sheet3 and sheet4. The pivot table on each sheet is called "PivotTable4" and the pivot item is called "Business". The pivot item contains 12 business names (Business1, Business2 etc etc)

Is there an easy way of doing this? I've spent the day looking through the internet and various "Dummies" books but with little success, I fear that I'm obviously below even Dummy level

View 5 Replies View Related

Move Data To List & Clear Entry Fields

Feb 15, 2010

this are function which button needs to be able to do after clicking on it.

• When the value of only one of Description or Unit/Price is entered, a warning message appears.

• When the message is confirmed, return to the entry status for the new data.

• When the values of both Description and Unit/Price are entered, save the values in the list of product (worksheet Product), and increase Product No. by 1 and erase values from NewProduct worksheet this is the screen how it should look but button which should be able to do all the thing above at once is called List Entry
[url]

after creating this function all the values from the table product need to be update into another table which sould look like that:
[url]

Is there anyone how could write code which will do thing above?

in the attachemnt is the excel file which shows what I have done so far, as i am not a good programmer,so I do not know if it's right

View 7 Replies View Related

Information To Enter The Tables And Then Automatically Move Into The Next Available Cells Below

Sep 23, 2008

I am trying to use visual basic editor in excel. I have all ready set up my user form where information can be entered, but I ave having trouble getting the information that is entered in the user form into the correct cells in excel.

I am wanting my information to enter the tables and then automatically move into the next available cells below.

Private Sub cmdadd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("details of cars in stock")
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
If Trim(Me.txtreg.Value) = "" Then
Me.txtreg.SetFocus
MsgBox "please enter a registraion number"
Exit Sub
End If
ws.Cells(iRow, 1).Value = Me.txtreg.Value
Me.txtreg.Value = ""

View 9 Replies View Related

VBA - Adjust Pivot Table Included Fields To Match Another Pivot Table

Mar 14, 2013

I have a worksheet with two pivot tables, one of which is visible to the user. Ideally, the user should be able to change the "Row Label" field settings of the visible pivot table and then press an "update button" that then adds the same field to the second pivot table.

Ideally, the ordering of the fields should also be made similar between the two tables, though this is of less priority.

I imagine it would be something in the style of:

"If number of Pivot1 active row label fields = X then
Pivot 2.AddRowLabelField = Pivot1.RowLabelField(X)
end if"

View 1 Replies View Related

How To Build Formula That Would Allow Remaining UOM

May 17, 2014

how to build a formula that would allow my remaining UOM and it's associated cells to move up to the days remaining UOM once my time goes below, say 31 days.

View 3 Replies View Related

Refresh Pivot Fields

Aug 7, 2006

The code to make all pivot fields in the "PivotTable1" equal exactly as chosen to the ones in "PivotTable2"? Cheers.

View 9 Replies View Related

How To Build A Formula In VBA That Can Paste Into A Cell

Apr 6, 2013

I need to run a loop to look up several columns.

My problem is that I need to build a formula that can sum each value in this row from the columns found when I'm done looping.

And then I was planning to just use "AutoFill", because of the large amount of rows this procedure has to cover.

Can I somehow create a code that will put each column number in memory, and then when done create formula like = "=SUM(G3, I3, AF3, BB3)" or something like "=SUM(& "i1" & 3, & "i2" & 3.... etc etc

I'm a little worried for overdoing loops as they have a tendency to slow down the speed.

View 4 Replies View Related

PivotTable Calculated Field With IF Function/Formula

Jun 23, 2008

I have a PivotTable which shows the number of packs produced in a month. I created a calculated field which shows the number of vehicles needed to move these packs. The number of packs per vehicle is dependent on two criteria, the Pack Description and the Store. My calculated field, Shunts, is described as:

=Packs / IF(Store ="Middlewich",IF('Pack desc' ="Tall",30,60),IF('Pack desc' ="Tall",26,52))

which represents the logic

Middlewich & Tall = Packs / 30
Middlewich & other = Packs / 60
Other & tall = Packs / 26
Other & other = Packs / 52

However, it doesn't work!

I know Calculated Fields can be difficult to work with, but this is crazy and I think I'm missing something obvious as I'm sure I've had IFs work like this before!
I've attached my example, also showing the values I'd expect to see.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved