Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
neoschenker
 
Posts: n/a
Default How do I use a pivot table value to reference a worksheet

I am trying to get the sytax right on a function that gets a value from a
pivot table:

=GETPIVOTDATA((cell("contents",a5))!B9,"Total Student Capacity")

I need it to get the contents from A5 which is the name of a worksheet in
the file. I've looked through help and tried a bunch of different things
with no luck. I have a long list of names that I don't want to have to
manually type in the sheet name as I will be adding in more data later. Any
help would be greatly appreciated.
  #2   Report Post  
JulieD
 
Posts: n/a
Default

Hi

if i understand you correctly
=GETPIVOTDATA("Total Student Capacity",INDIRECT(A5 &"!B9"))

hope this helps
Cheers
JulieD

"neoschenker" wrote in message
...
I am trying to get the sytax right on a function that gets a value from a
pivot table:

=GETPIVOTDATA((cell("contents",a5))!B9,"Total Student Capacity")

I need it to get the contents from A5 which is the name of a worksheet in
the file. I've looked through help and tried a bunch of different things
with no luck. I have a long list of names that I don't want to have to
manually type in the sheet name as I will be adding in more data later.
Any
help would be greatly appreciated.



  #3   Report Post  
neoschenker
 
Posts: n/a
Default

I tried using the INDIRECT function earlier today but that's a new one for
me. I thought the =getpivotdata function needed the reference first and then
the requested value - reverse of what you posted. I tried it both ways and
still got an error. It seems like it shouldn't tough to get the value from
A5 and use that for the sheet name. I can get it to work with
=GETPIVOTDATA(ANDERSON!B9,"Total Student Capacity") if the value in A5 is
"ANDERSON" but I can't find a way for it to pull that value and combine it
with !B9. I'm going to look at the INDIRECT function again in the help menu.
Thanks for replying.

"JulieD" wrote:

Hi

if i understand you correctly
=GETPIVOTDATA("Total Student Capacity",INDIRECT(A5 &"!B9"))

hope this helps
Cheers
JulieD

"neoschenker" wrote in message
...
I am trying to get the sytax right on a function that gets a value from a
pivot table:

=GETPIVOTDATA((cell("contents",a5))!B9,"Total Student Capacity")

I need it to get the contents from A5 which is the name of a worksheet in
the file. I've looked through help and tried a bunch of different things
with no luck. I have a long list of names that I don't want to have to
manually type in the sheet name as I will be adding in more data later.
Any
help would be greatly appreciated.




  #4   Report Post  
neoschenker
 
Posts: n/a
Default

i'm getting warmer. i got it to work by creating a new function at cell K5:
=CONCATENATE(A5,"!B9") then updating the main formula to:
=GETPIVOTDATA(INDIRECT(K5),"Total Student Capacity")

it may be hillbilly but it's getting the job done. Now it creates another
question - some of the values that are returned in K5 have a space in the
name such as:

DESERT HEIGHTS!B9 which is messing it all up giving me a #REF error. If
somebody knows of a good way around this I would appreciate the help. I'm
going to keep digging.....

"neoschenker" wrote:

I tried using the INDIRECT function earlier today but that's a new one for
me. I thought the =getpivotdata function needed the reference first and then
the requested value - reverse of what you posted. I tried it both ways and
still got an error. It seems like it shouldn't tough to get the value from
A5 and use that for the sheet name. I can get it to work with
=GETPIVOTDATA(ANDERSON!B9,"Total Student Capacity") if the value in A5 is
"ANDERSON" but I can't find a way for it to pull that value and combine it
with !B9. I'm going to look at the INDIRECT function again in the help menu.
Thanks for replying.

"JulieD" wrote:

Hi

if i understand you correctly
=GETPIVOTDATA("Total Student Capacity",INDIRECT(A5 &"!B9"))

hope this helps
Cheers
JulieD

"neoschenker" wrote in message
...
I am trying to get the sytax right on a function that gets a value from a
pivot table:

=GETPIVOTDATA((cell("contents",a5))!B9,"Total Student Capacity")

I need it to get the contents from A5 which is the name of a worksheet in
the file. I've looked through help and tried a bunch of different things
with no luck. I have a long list of names that I don't want to have to
manually type in the sheet name as I will be adding in more data later.
Any
help would be greatly appreciated.




  #5   Report Post  
JulieD
 
Posts: n/a
Default

put the ' ' around all the sheet names, shouldn't hurt if they don't have a
space in them
e.g.
=CONCATENATE("'",A5,"'!B9")
single quote between a double in the first element to concatenate
single quote between the double and the exclaimation mark in the third


"neoschenker" wrote in message
...
i'm getting warmer. i got it to work by creating a new function at cell
K5:
=CONCATENATE(A5,"!B9") then updating the main formula to:
=GETPIVOTDATA(INDIRECT(K5),"Total Student Capacity")

it may be hillbilly but it's getting the job done. Now it creates another
question - some of the values that are returned in K5 have a space in the
name such as:

DESERT HEIGHTS!B9 which is messing it all up giving me a #REF error. If
somebody knows of a good way around this I would appreciate the help. I'm
going to keep digging.....

"neoschenker" wrote:

I tried using the INDIRECT function earlier today but that's a new one
for
me. I thought the =getpivotdata function needed the reference first and
then
the requested value - reverse of what you posted. I tried it both ways
and
still got an error. It seems like it shouldn't tough to get the value
from
A5 and use that for the sheet name. I can get it to work with
=GETPIVOTDATA(ANDERSON!B9,"Total Student Capacity") if the value in A5 is
"ANDERSON" but I can't find a way for it to pull that value and combine
it
with !B9. I'm going to look at the INDIRECT function again in the help
menu.
Thanks for replying.

"JulieD" wrote:

Hi

if i understand you correctly
=GETPIVOTDATA("Total Student Capacity",INDIRECT(A5 &"!B9"))

hope this helps
Cheers
JulieD

"neoschenker" wrote in message
...
I am trying to get the sytax right on a function that gets a value
from a
pivot table:

=GETPIVOTDATA((cell("contents",a5))!B9,"Total Student Capacity")

I need it to get the contents from A5 which is the name of a
worksheet in
the file. I've looked through help and tried a bunch of different
things
with no luck. I have a long list of names that I don't want to have
to
manually type in the sheet name as I will be adding in more data
later.
Any
help would be greatly appreciated.







  #6   Report Post  
neoschenker
 
Posts: n/a
Default

thank you so much for replying. that worked perfectly.

"JulieD" wrote:

put the ' ' around all the sheet names, shouldn't hurt if they don't have a
space in them
e.g.
=CONCATENATE("'",A5,"'!B9")
single quote between a double in the first element to concatenate
single quote between the double and the exclaimation mark in the third


"neoschenker" wrote in message
...
i'm getting warmer. i got it to work by creating a new function at cell
K5:
=CONCATENATE(A5,"!B9") then updating the main formula to:
=GETPIVOTDATA(INDIRECT(K5),"Total Student Capacity")

it may be hillbilly but it's getting the job done. Now it creates another
question - some of the values that are returned in K5 have a space in the
name such as:

DESERT HEIGHTS!B9 which is messing it all up giving me a #REF error. If
somebody knows of a good way around this I would appreciate the help. I'm
going to keep digging.....

"neoschenker" wrote:

I tried using the INDIRECT function earlier today but that's a new one
for
me. I thought the =getpivotdata function needed the reference first and
then
the requested value - reverse of what you posted. I tried it both ways
and
still got an error. It seems like it shouldn't tough to get the value
from
A5 and use that for the sheet name. I can get it to work with
=GETPIVOTDATA(ANDERSON!B9,"Total Student Capacity") if the value in A5 is
"ANDERSON" but I can't find a way for it to pull that value and combine
it
with !B9. I'm going to look at the INDIRECT function again in the help
menu.
Thanks for replying.

"JulieD" wrote:

Hi

if i understand you correctly
=GETPIVOTDATA("Total Student Capacity",INDIRECT(A5 &"!B9"))

hope this helps
Cheers
JulieD

"neoschenker" wrote in message
...
I am trying to get the sytax right on a function that gets a value
from a
pivot table:

=GETPIVOTDATA((cell("contents",a5))!B9,"Total Student Capacity")

I need it to get the contents from A5 which is the name of a
worksheet in
the file. I've looked through help and tried a bunch of different
things
with no luck. I have a long list of names that I don't want to have
to
manually type in the sheet name as I will be adding in more data
later.
Any
help would be greatly appreciated.






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
Using a Pivot Table Calculated Field to get a Unique Count Mike Struckman Excel Worksheet Functions 1 November 22nd 05 05:32 PM
Pivot Table services Craig Excel Discussion (Misc queries) 5 January 19th 05 06:11 PM
Indirect reference from one worksheet to another Bill Sturdevant Excel Worksheet Functions 2 December 17th 04 01:23 PM
Copy worksheet with Pivot Table and break link to original workshe setter-lover Excel Worksheet Functions 0 November 18th 04 09:29 PM
Problem with Pivot Table Drop-Down Menus Mac Excel Worksheet Functions 4 November 7th 04 01:18 PM


All times are GMT +1. The time now is 11:38 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"