How to make cells selection linked to a Pivot table dynamic? - excel

I have a Pivot table and a formula with range of cells linked to this Pivot table. If I add a new row to the pivot source data, my Pivot table dynamically recognizes this and adjusts (i.e. adds a new row), however the linked selection does not (green selection, see image below; the last two rows were newly added to the Pivot source data).
Is there any way how to make sure that the selection updates with the Pivot? I would like to have the green selection dynamically adjust together with the pivot if possible. Thank you.

Thanks Fernando for a tip. In the end I have managed to do it a bit differently.
I have replaced the COUNTA function in the OFFSET with the count of unique values in Row Labels (in my case they are names of companies and each company has one value for each year range 2014-2016, 2017-2019).
I.e. now the OFFSET height is a result of formula which calculates the count of Row Labels meaning that every time I add a new company to my source pivot data the count of unique company names increases by one and consequently the AVERAGE range does too.
How to count unique values can be found here.

Related

Excel Creating New Sheet with Summed Data from related sheet

Lets say I have the following on a sheet.
By some means, I want to either replace this, or preferably, create a new sheet, with the following data. Notice, that PO# is out of the picture, and a summation is done on rest of the fields. Is there a way to easily do this?
The end result has to be data in excel grid like below (preferably on a new sheet). This can possibly be some macro or some other technique I can use to easily create this....
You can easily do this with SUMIFS() or a Pivot Table.
For SUMIFS() the below equation will give you the sum for W.PS123 Product A. Modify as needed for your other criteria by swapping AR and product number (both housed in quotes in below formula, you can also set these equal to a cell range that contains desired criteria).
If you have a set number of "ARs" and Product Numbers, you will only need to build this table once and the equations will automatically update as your raw data changes.
=SUMIFS(C:C,A:A,"W.PS123",E:E,"A")
Alternatively, you can build a pivot table and just refresh this every time your data updates (or create a worksheet_change macro to refresh the table automatically when your data changes).
To build your pivot:
Highlight your table array (In your example, Col A-D)
Insert > Pivot Table
Drag AR to Rows
Drag PRODUCT to Rows (Below AR)
Drag QTY to "Values" and change the field to "Sum" rather the default count
Format to taste

How do I create a custom grand total or calculated field in my pivot table in Excel?

I have a pivot table with various calculated fields. I want one of these calculated fields to change depending on what I choose from the slicer. In order to help understand what I'm trying to do I can provide some screenshots:
Here each row contains information for one SITA and each column is a calculated field. The Var(%) column is (ABS(OTB Occupancy - OFF Occupancy))/OTB Occupancy. The very last entry in Var(%) is calculated manually and takes the average of the column (this restricts me from filtering the pivot table as I'll have to recalculate the formula and/or move it to another cell so it stays in the position where it is the last cell).
Now my problem is I am no longer using this pivot table but I am starting to create other pivot tables which need to be more dynamic than this one. For example:
As you can see the first two entries of April in the pivot table correspond with the previous pivot table (OTB Occupancy and OFF Occupancy are the same as Sum of Act_Occ and Sum of Fct_Occ respectively). However, I need the third column to be the average given in the last entry of Var(%). (Please note that this cell isn't part of the pivot table and it's just a formula i used). But also, if I were to select two SITAs only from the slicer I'll want only the average of them two.
I'm not sure if excel can do what I want but any help is appreciated.

Excel Pivot Table Exclude one Row in Calculated Field

In Microsoft Excel I want to have a pivot table that uses a calculated field for a row. I would like the calculated Row to exlude the current year. So I want two summary rows one with current year and one without. The attachment in orange shows my desired result.
I know I can manually make the cell formula for each month, but I would like it to be automatic. Any thoughts?
If your row variable was called "Year", your column variable called "Month", E1 was one of the cells in your pivot table and your values variable was called "Score", you could do something like
=GETPIVOTDATA("Score",E1,"Month","Jan")-GETPIVOTDATA("Score",E1,"Month","Jan","Year",YEAR(NOW()))
and repeat for each month.
However you would need to leave room under the table for it to expand to avoid over-writing your orange cells.
The only other way I can think of is the obvious one of copying the whole pivot table and filtering on row labels, excluding 2015.
You can copy a pivot table by selecting the whole table (can use Ctrl Shift *), right-clicking, selecting Copy and then pasting it somewhere else.
This is a mini-example showing the two methods.

How do I return the nth to nth+10 largest value labels in a pivot table?

There has got to be a way to do this, but I can't figure it out. It's easy to get a pivot table (and pivot chart) to display the top-10 based on subtotal values. But, I want the pivot table to display the 11th to 20th largest rows based on subtotal values. The problem is that the number of lines and columns in the pivot table are dynamic, based on ever-changing source data.
I've tried filtering the pivot table, but I can filter only for the top or bottom values, not for arbitrary LARGE() ranges in the middle. I've also tried to set up a field outside the pivot table that identifies the 11th-20th largest rows, but this field breaks if the number of rows or columns in the pivot table changes.
Are there any other ideas out there? Unfortunately, the PowerPivot or PowerQuery tools aren't available for me. Just vanilla Excel 2013.
Not a lot to go on but I'm guessing you have totals for rows and wish to filter these by rank. If so, maybe repeat this Sigma values entry and for this change Show Values As to Rank Largest to Smallest, then filter the column (not just the PT) containing the new row totals with Number Filters, Between..., is greater than or equal to 11, select And, is less than or equal to 20.

Trying add up values but have multiple entries

I am trying to look up the value in one column and pull the number from another column.
Of course, I could use the simple V-lookup or Match.
However, the first column of data has multiple entries that are the same. If I Vlookup it is just going to pull the first number in the second column.
I need to pull each number from the second column and somehow add them together. Despite the fact I have multiple entries.
If there is a way to consolidate the multiple entries in 1st column while also summing up the numbers in the 2nd, that would be great.
I would recommend a Pivot Table. To create one, select a cell in your data range (which needs to have column names in the first row. Choose Insert / Pivot Table from the Ribbon and select the New Worksheet option for the location.
In the Pivot Table list on the new worksheet, drag the name of the first column to the Row Labels box and the name of the second column to the Values box. The name in the Values box should turn to Sum of <2nd column name>.
The Pivot Table will now show a sorted list of the column 1 values and the summed values of column 2. In the example, you'll see that
Does SUMIF do what you are looking for?

Resources