Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default GetPivotData with variable criteria input? (revisited!)

Hi,
Back in 2004, Jeff Borden asked about using GetPivotData with variable
criteria output. Here's his original question: http://tinyurl.com/2saafw
I have exactly the same issue. Debra Dalgleish supplies a working
solution, which is great, but its complexity makes maintenance an
issue. I am asking this question again in case anyone has any other
ideas?

I have a pivot table with 5 column fields.

On a different sheet, I want the user to be able to enter between one
and 5 criteria values and to have one GetPivotData function that will
catch them all.

For example, a user could enter any one of the three following options
in the five criteria boxes:
c1 c2 c3 c4 c5
In In Out Off On
In Out Out
In

The problem is that the GETPIVOTDATA function returns '#REF!' because
nothing in the pivot table matches for c4 and c5 criteria of
"" (blank).

My first thought it is to write a custom VBA function, GetPivotDataEx
which first checks for blank criteria, and then calls GetPivotData
itself with the empty parameters removed. Using VBA is okay within our
organisation, but I would rather avoid it.

Thanks in advance!

Andy

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default GetPivotData with variable criteria input? (revisited!)

PS - I had originally hoped that the criteria would ALWAYS read from
left to right, in which case Debra's solution would at least work.

I now don't think that will be the case: there may be some gaps - ie
someone may fill in criterias 1, 3, and 5, leaving 2 and 4 blank.

If that's the case, the nested IFs won't work.

Any ideas?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,480
Default GetPivotData with variable criteria input? (revisited!)

Hi Andy

I'm having trouble envisaging your layout.
If you want to mail me a copy of your file, I would be happy to take a look
and see if I can come up with a solution.
To mail direct
roger at technology4u dot co dot uk
Do the obvious with at and dot.

--
Regards
Roger Govier



"AndyCotgreave" wrote in message
oups.com...
Hi,
Back in 2004, Jeff Borden asked about using GetPivotData with variable
criteria output. Here's his original question: http://tinyurl.com/2saafw
I have exactly the same issue. Debra Dalgleish supplies a working
solution, which is great, but its complexity makes maintenance an
issue. I am asking this question again in case anyone has any other
ideas?

I have a pivot table with 5 column fields.

On a different sheet, I want the user to be able to enter between one
and 5 criteria values and to have one GetPivotData function that will
catch them all.

For example, a user could enter any one of the three following options
in the five criteria boxes:
c1 c2 c3 c4 c5
In In Out Off On
In Out Out
In

The problem is that the GETPIVOTDATA function returns '#REF!' because
nothing in the pivot table matches for c4 and c5 criteria of
"" (blank).

My first thought it is to write a custom VBA function, GetPivotDataEx
which first checks for blank criteria, and then calls GetPivotData
itself with the empty parameters removed. Using VBA is okay within our
organisation, but I would rather avoid it.

Thanks in advance!

Andy



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default GetPivotData with variable criteria input? (revisited!)

Just to let any readers know, Roger came up with a very intelligent
alternative approach usign SUMPRODUCT.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Same Issue

I am facing pretty much the same issue & have been scratching my head for a few weeks now :-(

Care to share Roger's solution?? :-)

Thanks!
Mathew




AndyCotgreave wrote:

Just to let any readers know, Roger came up with a very intelligentalternative
05-Oct-07

Just to let any readers know, Roger came up with a very intelligent
alternative approach usign SUMPRODUCT.

Previous Posts In This Thread:

On Wednesday, October 03, 2007 6:52 AM
AndyCotgreave wrote:

GetPivotData with variable criteria input? (revisited!)
Hi,
Back in 2004, Jeff Borden asked about using GetPivotData with variable
criteria output. Here's his original question: http://tinyurl.com/2saafw
I have exactly the same issue. Debra Dalgleish supplies a working
solution, which is great, but its complexity makes maintenance an
issue. I am asking this question again in case anyone has any other
ideas?

I have a pivot table with 5 column fields.

On a different sheet, I want the user to be able to enter between one
and 5 criteria values and to have one GetPivotData function that will
catch them all.

For example, a user could enter any one of the three following options
in the five criteria boxes:
c1 c2 c3 c4 c5
In In Out Off On
In Out Out
In

The problem is that the GETPIVOTDATA function returns '#REF!' because
nothing in the pivot table matches for c4 and c5 criteria of
"" (blank).

My first thought it is to write a custom VBA function, GetPivotDataEx
which first checks for blank criteria, and then calls GetPivotData
itself with the empty parameters removed. Using VBA is okay within our
organisation, but I would rather avoid it.

Thanks in advance!

Andy

On Wednesday, October 03, 2007 7:38 AM
AndyCotgreave wrote:

PS - I had originally hoped that the criteria would ALWAYS read fromleft to
PS - I had originally hoped that the criteria would ALWAYS read from
left to right, in which case Debra's solution would at least work.

I now don't think that will be the case: there may be some gaps - ie
someone may fill in criterias 1, 3, and 5, leaving 2 and 4 blank.

If that's the case, the nested IFs won't work.

Any ideas?

On Wednesday, October 03, 2007 7:53 AM
Roger Govier wrote:

Hi AndyI'm having trouble envisaging your layout.
Hi Andy

I'm having trouble envisaging your layout.
If you want to mail me a copy of your file, I would be happy to take a look
and see if I can come up with a solution.
To mail direct
roger at technology4u dot co dot uk
Do the obvious with at and dot.

--
Regards
Roger Govier



"AndyCotgreave" wrote in message
oups.com...

On Friday, October 05, 2007 11:56 AM
AndyCotgreave wrote:

Just to let any readers know, Roger came up with a very intelligentalternative
Just to let any readers know, Roger came up with a very intelligent
alternative approach usign SUMPRODUCT.


Submitted via EggHeadCafe - Software Developer Portal of Choice
ASP.NET Track Visitor Information With Custom HttpHandlers
http://www.eggheadcafe.com/tutorials...sitor-inf.aspx
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I use a worksheet name as an input variable to a formula? tonymotion Excel Discussion (Misc queries) 6 September 5th 07 04:37 AM
With QUERY how to input a variable Guillaume Excel Discussion (Misc queries) 1 December 8th 05 02:28 PM
Formulas containing variable input ym4life Excel Discussion (Misc queries) 5 August 16th 05 01:07 PM
Variable Input Range for Combo Box Defoes Right Boot Excel Worksheet Functions 2 July 20th 05 03:44 PM
can you use a variable or cell reference in a getpivotdata formul. stevec Excel Worksheet Functions 1 November 8th 04 09:20 PM


All times are GMT +1. The time now is 11:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"