Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Pivot Table w/IF Stmt

I've been given an Access database that pulls data from an ODBC source. An
Excel file then links to Access tables. Below is an example of a formula on
an Excel spreadsheet - I am getting #REF errors because, I think, there is no
match in D16 in the pivot table which is because there's no data for either
January or February in the ODBC source. Is there a way to combine an IF
statement with the formula below to put a 0 in the cell so it doesn't error
off? Any other ideas? Any help would be so very much appreciated!! Jani
=GETPIVOTDATA("Recordable1",'Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Pivot Table w/IF Stmt

as a worst case try

if(iserror(=GETPIVOTDATA("Recordable1",'Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16)),0,=GETPIVOTDATA("Recordable1",' Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16))


--
Regards,
Tom Ogilvy


"Jani" wrote:

I've been given an Access database that pulls data from an ODBC source. An
Excel file then links to Access tables. Below is an example of a formula on
an Excel spreadsheet - I am getting #REF errors because, I think, there is no
match in D16 in the pivot table which is because there's no data for either
January or February in the ODBC source. Is there a way to combine an IF
statement with the formula below to put a 0 in the cell so it doesn't error
off? Any other ideas? Any help would be so very much appreciated!! Jani
=GETPIVOTDATA("Recordable1",'Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Pivot Table w/IF Stmt

Thanks, Tom... but didn't work. I put an = sign in front of IF and took it
out before the GETs. Any other thoughts?

"Tom Ogilvy" wrote:

as a worst case try

if(iserror(=GETPIVOTDATA("Recordable1",'Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16)),0,=GETPIVOTDATA("Recordable1",' Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16))


--
Regards,
Tom Ogilvy


"Jani" wrote:

I've been given an Access database that pulls data from an ODBC source. An
Excel file then links to Access tables. Below is an example of a formula on
an Excel spreadsheet - I am getting #REF errors because, I think, there is no
match in D16 in the pivot table which is because there's no data for either
January or February in the ODBC source. Is there a way to combine an IF
statement with the formula below to put a 0 in the cell so it doesn't error
off? Any other ideas? Any help would be so very much appreciated!! Jani
=GETPIVOTDATA("Recordable1",'Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Pivot Table w/IF Stmt

NO - You were correct! I didn't delete all the old code. Thanks!!! Jani

"Tom Ogilvy" wrote:

as a worst case try

if(iserror(=GETPIVOTDATA("Recordable1",'Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16)),0,=GETPIVOTDATA("Recordable1",' Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16))


--
Regards,
Tom Ogilvy


"Jani" wrote:

I've been given an Access database that pulls data from an ODBC source. An
Excel file then links to Access tables. Below is an example of a formula on
an Excel spreadsheet - I am getting #REF errors because, I think, there is no
match in D16 in the pivot table which is because there's no data for either
January or February in the ODBC source. Is there a way to combine an IF
statement with the formula below to put a 0 in the cell so it doesn't error
off? Any other ideas? Any help would be so very much appreciated!! Jani
=GETPIVOTDATA("Recordable1",'Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16)

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Pivot Table w/IF Stmt

Tom - Can you tell I'm in way to much of a hurry to get this done? There is a
problem in that the formula always enters a 0. It is not picking up if there
is data. Thoughts??? Jani

"=IF(ISERROR(GETPIVOTDATA(""Recordable1"",'Recorda ble
-CY'!$A$204,""Region"",C16,""Location"",B16,""Month _"",E$4,""Division"",D16)),0,GETPIVOTDATA(""Record able1"",'Recordable
-CY'!$A$204,""Region"",C16,""Location"",B16,""Month _"",E$4,""Division"",D16))"


"Tom Ogilvy" wrote:

as a worst case try

if(iserror(=GETPIVOTDATA("Recordable1",'Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16)),0,=GETPIVOTDATA("Recordable1",' Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16))


--
Regards,
Tom Ogilvy


"Jani" wrote:

I've been given an Access database that pulls data from an ODBC source. An
Excel file then links to Access tables. Below is an example of a formula on
an Excel spreadsheet - I am getting #REF errors because, I think, there is no
match in D16 in the pivot table which is because there's no data for either
January or February in the ODBC source. Is there a way to combine an IF
statement with the formula below to put a 0 in the cell so it doesn't error
off? Any other ideas? Any help would be so very much appreciated!! Jani
=GETPIVOTDATA("Recordable1",'Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16)



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Pivot Table w/IF Stmt

If that doesn't work (and it may not - I never use GetPivotData - it is too
verbose for me)

Possibly you can use countif to see if the data you are looking for is
there. so as a general approach,

=if(sum(month(B1:B300)=1)=0,0,Getpivotformula)

entered with Ctrl+shift+Enter

in the =1, replace with Month(cell that contains a date with the month)

You know how your data is laid out and what you are looking for, so adapt
the approach to your specifics.

--
regards,
Tom Ogilvy


"Jani" wrote:

Tom - Can you tell I'm in way to much of a hurry to get this done? There is a
problem in that the formula always enters a 0. It is not picking up if there
is data. Thoughts??? Jani

"=IF(ISERROR(GETPIVOTDATA(""Recordable1"",'Recorda ble
-CY'!$A$204,""Region"",C16,""Location"",B16,""Month _"",E$4,""Division"",D16)),0,GETPIVOTDATA(""Record able1"",'Recordable
-CY'!$A$204,""Region"",C16,""Location"",B16,""Month _"",E$4,""Division"",D16))"


"Tom Ogilvy" wrote:

as a worst case try

if(iserror(=GETPIVOTDATA("Recordable1",'Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16)),0,=GETPIVOTDATA("Recordable1",' Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16))


--
Regards,
Tom Ogilvy


"Jani" wrote:

I've been given an Access database that pulls data from an ODBC source. An
Excel file then links to Access tables. Below is an example of a formula on
an Excel spreadsheet - I am getting #REF errors because, I think, there is no
match in D16 in the pivot table which is because there's no data for either
January or February in the ODBC source. Is there a way to combine an IF
statement with the formula below to put a 0 in the cell so it doesn't error
off? Any other ideas? Any help would be so very much appreciated!! Jani
=GETPIVOTDATA("Recordable1",'Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16)

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Pivot Table w/IF Stmt

I'll give it a try, Tom. Thank you!

"Tom Ogilvy" wrote:

If that doesn't work (and it may not - I never use GetPivotData - it is too
verbose for me)

Possibly you can use countif to see if the data you are looking for is
there. so as a general approach,

=if(sum(month(B1:B300)=1)=0,0,Getpivotformula)

entered with Ctrl+shift+Enter

in the =1, replace with Month(cell that contains a date with the month)

You know how your data is laid out and what you are looking for, so adapt
the approach to your specifics.

--
regards,
Tom Ogilvy


"Jani" wrote:

Tom - Can you tell I'm in way to much of a hurry to get this done? There is a
problem in that the formula always enters a 0. It is not picking up if there
is data. Thoughts??? Jani

"=IF(ISERROR(GETPIVOTDATA(""Recordable1"",'Recorda ble
-CY'!$A$204,""Region"",C16,""Location"",B16,""Month _"",E$4,""Division"",D16)),0,GETPIVOTDATA(""Record able1"",'Recordable
-CY'!$A$204,""Region"",C16,""Location"",B16,""Month _"",E$4,""Division"",D16))"


"Tom Ogilvy" wrote:

as a worst case try

if(iserror(=GETPIVOTDATA("Recordable1",'Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16)),0,=GETPIVOTDATA("Recordable1",' Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16))


--
Regards,
Tom Ogilvy


"Jani" wrote:

I've been given an Access database that pulls data from an ODBC source. An
Excel file then links to Access tables. Below is an example of a formula on
an Excel spreadsheet - I am getting #REF errors because, I think, there is no
match in D16 in the pivot table which is because there's no data for either
January or February in the ODBC source. Is there a way to combine an IF
statement with the formula below to put a 0 in the cell so it doesn't error
off? Any other ideas? Any help would be so very much appreciated!! Jani
=GETPIVOTDATA("Recordable1",'Recordable
-CY'!$A$204,"Region",C16,"Location",B16,"Month_",E$ 4,"Division",D16)

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 to create pivot table from existing pivot table in excel 2007 Udayraj Dhulekar Excel Discussion (Misc queries) 2 July 8th 13 08:22 PM
Print Pivot Table headers on pages with Pivot Table tsgoose Excel Worksheet Functions 0 December 9th 08 08:14 PM
Filter lines with Pivot table and non Pivot table columns Grover Excel Discussion (Misc queries) 1 September 26th 07 12:48 AM
Filter lines containing pivot table and non pivot table data Grover Excel Worksheet Functions 0 September 24th 07 07:20 PM
Help required with setting up a pivot table with the source on sheet1 to have the pivot table created on sheet called "report" Diana[_5_] Excel Programming 0 August 21st 03 10:19 PM


All times are GMT +1. The time now is 06:32 PM.

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

About Us

"It's about Microsoft Excel"