+ Reply to Thread
Results 1 to 10 of 10

Thread: GETPIVOTDATA formula help

  1. #1
    Registered User
    Join Date
    03-09-2010
    Location
    Seattle, Washington
    MS-Off Ver
    Excel 2007
    Posts
    5

    Unhappy GETPIVOTDATA formula help

    I am working on a report that is using GETPIVOTDATA formulas to pull in data from a pivot table which is on a separate workbook. Here is the formula:

    =GETPIVOTDATA("Tot Pub Est Hrs",'[PRISM Project Estimates_03.09.10.xls]EIT MobSys'!$A$5,"PID","184178","APP","Granite")

    The problem is that I would like to copy this formula down the sheet and use information in other columns within this sheet to reference instead of stating the information. For example, instead of using ,"PID","184178" in the above example, I would use ,"PID",B3 & "". This works great for PID but when I apply the same replacement for APP (instead of "Granite") it returns an error.

    The APP information is in column U on my spreadsheet. I have tried replacing "Granite" with U3 and U3 & "" and neither work.

    Thanks for any help you can provide!
    Last edited by NBVC; 03-10-2010 at 04:19 PM.

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: GETPIVOTDATA formula help

    Are you sure that U3 doesn't contain any extra spaces, etc... and is spelled exactly the same...
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    03-09-2010
    Location
    Seattle, Washington
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: GETPIVOTDATA formula help

    Well, I thought I had checked that but apparently there is something in the format that is causing the error which now has me stumped. I know there's something wrong with my data because when I copy the cell from the pivot data sheet that contains Granite and then paste that into cell U3, the formula containing "APP",U3 & "" works.

    I've tried cleaning up the data by using TRIM and TEXT formulas. I also used these on the data in column U and the formula still won't recognize it as the same data. Any suggestions on how else to clean up the data?

  4. #4
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: GETPIVOTDATA formula help

    What does

    =Code(Left(U3))

    and

    =Code(Right(U3))

    yield?
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #5
    Registered User
    Join Date
    03-09-2010
    Location
    Seattle, Washington
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: GETPIVOTDATA formula help

    =Code(Left(U3)) yields 66

    and

    =Code(Right(U3)) yields 160

  6. #6
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: GETPIVOTDATA formula help

    you have a special not printable character at the end of the text in U3.. that is code 0160

    You can remove it by selecting the cell or cells, then go to Edit|Replace

    Hold down the ALT key and enter 0160 (using only the numberpad of the keyboard) in the Find What Field... leave the Replace With field empty and click Replace All.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  7. #7
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: GETPIVOTDATA formula help

    Or, if you are unable / unwilling to amend the source values you could try embedding your reference to U3 within a SUBSTITUTE call (within the GETPIVOTDATA function)

    =GETPIVOTDATA("Tot Pub Est Hrs",'[PRISM Project Estimates_03.09.10.xls]EIT MobSys'!$A$5,"PID",B3&"","APP",SUBSTITUTE(U3,CHAR(160),""))

  8. #8
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: GETPIVOTDATA formula help

    I was actually going to show that too... but figured it is better to clean your data than to "ignore" it....
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  9. #9
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: GETPIVOTDATA formula help

    Agreed in principle but I think it all boils down to the context (he says, stating the obvious!)

    If the corrections should prove to be a one-off exercise then I'm with you...

    (IME CHAR(160) often results from web imports... if it transpires that the underlying values are "refreshed" on demand then manual corrections might not be viable and SUBSTITUTE might be a suitable alternative)

  10. #10
    Registered User
    Join Date
    03-09-2010
    Location
    Seattle, Washington
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: GETPIVOTDATA formula help

    Problem solved! Both solutions will come in handy for me going forward I'm sure. Thanks for the help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0