+ Reply to Thread
Results 1 to 4 of 4

Use a Calculated Field to reference an adjacent cell of a Pivot table to calculate a total

  1. #1
    Registered User
    Join Date
    09-22-2010
    Location
    California
    MS-Off Ver
    Office 2007
    Posts
    13

    Use a Calculated Field to reference an adjacent cell of a Pivot table to calculate a total

    I play a game (Animal Crossing: New Horizons) where I'm trying to collect "DIY Recipe Cards". I'd like to share a spreadsheet (google sheets) with people online who may be interested in helping me.

    The idea is that I would post a link to the spreadsheet in a forum of other players, and then users can put their name next to the DIY Recipe Cards they have that I need (Column A). Based on the number of cards they have available and want to get paid for (by putting their name in Column A), a Pivot table will populate with their name, how many cards they plan to provide, and how much I will pay (the in-game currency is called NMT).

    I can't seem to figure out what formula to use in a Pivot Table's Calculated Field to correctly calculate how much they will be owed (to be displayed in Column K) based on my rates posted in Columns D-G.

    I tried to reference adjacent cells of the pivot table using the following formula, but it doesn't seem to work in Google Sheets at all. It works in Excel, but it's not dynamic so as new names are added and the pivot table expands, the Grand Total row may display a calculated total which I'm not looking for:
    Please Login or Register  to view this content.
    I've tried using Named Ranges and GETPIVOTDATA as well and only get errors.

    Any tips/suggestions are greatly appreciated. Thanks!

    Google Sheets Version of Spreadsheet
    Please Login or Register  to view this content.
    Full Disclosure: I've also posted this on Google Docs Editors Help but hadn't received a response from anyone.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by LuckyDay; 10-23-2020 at 03:08 PM. Reason: SOLVED

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,521

    Re: Use a Calculated Field to reference an adjacent cell of a Pivot table to calculate a t

    Not sure why you chose to use the RC[-1] references as opposed to J2 etc and I have no idea what works with google sheets.
    However the following will leave a blank cell on a "Grand Total" row and also on a row where no name is listed:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Paste the above formula into cell K2 and then drag the fill handle down to cell K10 for illustration.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Registered User
    Join Date
    09-22-2010
    Location
    California
    MS-Off Ver
    Office 2007
    Posts
    13

    Re: Use a Calculated Field to reference an adjacent cell of a Pivot table to calculate a t

    Thank you for this -- this was a much simpler solution than trying to force the field into the Pivot Table. Much appreciated.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,521

    Re: Use a Calculated Field to reference an adjacent cell of a Pivot table to calculate a t

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Pivot Table: Calculated Field based on Running Total Field
    By EvolvingMonkey in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-07-2016, 06:27 AM
  2. Replies: 0
    Last Post: 08-15-2016, 02:07 PM
  3. [SOLVED] Calculated Field in Pivot table - Need to Calculate again
    By vinaynaran in forum Excel General
    Replies: 3
    Last Post: 11-14-2013, 01:03 PM
  4. Replies: 1
    Last Post: 12-10-2012, 05:41 AM
  5. Replies: 2
    Last Post: 04-14-2011, 09:33 AM
  6. [SOLVED] Using '% of Total' in calculated field in Pivot Table
    By goofy11 in forum Excel General
    Replies: 2
    Last Post: 05-09-2006, 06:35 PM
  7. [SOLVED] Missing Grand Total for a Calculated Field in a Pivot Table
    By Robert Hamilton in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-07-2006, 02:20 PM

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.6.0 RC 1