pivot formula: Reference to cell outside of pivottable?

deduijk

New Member
Joined
Mar 13, 2012
Messages
2
Hi all,

I have searched and searched. Unfortunately i haven't found an answer to the question; how (IF) can i reference a field outside of the pivot table in a pivot table field formula?

What do i want:
To compare a calculated field in the pivottable [that contains percentage of row] to 'Activesheet!$A$1'
If the calculated field is higher than cell value i want to show that field.
I want to hide all the fields where it is less or equal to that value


Problem1:
When i try to reference the 'Activesheet!$A$1' field inside of a pivot table formula it states no reference can be made ('references to matrix, named...' are not supported...')

Problem2:
I can't select a calculated field as a filter criteria?
(i can work around this by using the calc field in table and then setting filter on that column, so this is less of a problem than problem 1)


if Problem1 is impossible to solve:
Is there a way to get the total number of columns and use that in the pivot table formula?

If an example is needed let me know and i will provide one (the workbook this is all in is quite heavy with vba code; so will create one without, so it is more clear than).

Thank you kindly!,
deduijk
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
hi, deduijk

Say the current PT source data is named (non-dynamic) MyData

Put a header above the single cell. Give it a non-dynamic name also. Say, MyCell

There will now be two named ranges. MyData with headers & data and the small table MyCell that has a header and one data item.

Manual approach. Create a pivot table from a new Excel file. At the first step of the wizard (ALT-D-P) choose the external data option. Follow the wizard to the end and choose the option to edit in MS Query. Edit the SQL to suit. Obviously the SQL will be specific to your set up. Its form will be something like,
Code:
SELECT M.your fields
FROM MyData M, MyCell C
WHERE [your calculated field] > C.[field name]
(Though a little more complicated as the calculated field is a percentage of a subtotal.)

Complete the pivot table and move the resultant worksheet into the source data file if you want.

HTH
 
Upvote 0
Thanks! i'll give it a try.

I assume it works with a dynamic (named range) as well?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,172
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top