+ Reply to Thread
Results 1 to 2 of 2

Remove Pivot Table fields with blank rows

  1. #1
    Registered User
    Join Date
    11-19-2012
    Location
    Manassas Park
    MS-Off Ver
    Excel 2007
    Posts
    6

    Remove Pivot Table fields with blank rows

    I have a table that I want to create a dynamic pivot chart, but I can't figure out how to apply this logic correctly:

    If Proposed Cost > 0 and Actual Cost == blank:
    Show Proposed Cost ONLY
    Else:
    Show Actual Cost ONLY

    A simple table I have may look like this:

    Name // Proposed Cost // Actual Cost
    A // 100 // 125
    B // 100 // 100
    C // 50 //
    D // 75 // 150
    E // 100
    F // 90

    What I'd like my pivot table to do is every time I select a macro'd table, it shows me one of two things: JUST the Actual Cost or JUST the Proposed Cost

    So for the ACTUAL COST, I'd expect to see info for persons A, B, D
    For the PROPOSED COST, I'd expect to see info for persons C, E, F

    Is there a way to make this a macro so that Excel is smart enough to know that when I click on the PivotTable fields to clear them and de-select ONLY those fields marked as blank, it will return the expected results in my Pivot Table?

    Thank you!

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Remove Pivot Table fields with blank rows

    Use a calculated field =IF(AND('Proposed Cost'>0,ISBLANK('Actual Cost')),'Proposed Cost','Actual Cost')

    Given the logic, when the actual cost is displayed, it's always zero.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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. Remove data fields from pivot table using VBA in Excel for Mac 2011
    By RiaM in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 05-15-2013, 04:36 AM
  2. Remove Row Fields from Pivot Table
    By meherd in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 09-19-2012, 08:56 AM
  3. Add and Remove the Fields in an existent Pivot Table through VBA
    By RagonichaFulva in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-24-2012, 10:15 AM
  4. Replies: 1
    Last Post: 04-25-2011, 01:17 PM
  5. Replies: 1
    Last Post: 04-25-2011, 01:17 PM
  6. VBA to remove all sub-totals in Pivot Table Fields
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-22-2008, 06:48 PM
  7. [SOLVED] How to remove Drop Page Fields Here from Pivot Table
    By wengyee in forum Excel General
    Replies: 2
    Last Post: 06-03-2005, 06:05 PM

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