+ Reply to Thread
Results 1 to 5 of 5

Pivot table formula problem

  1. #1
    Registered User
    Join Date
    06-10-2014
    Location
    Kansas City, MO
    MS-Off Ver
    Excel 97
    Posts
    26

    Pivot table formula problem

    I'm trying calculate the difference between 2 columns in a pivot table. The first column always has a number in it, but the 2nd column is sometimes blank. I want to calculate the difference only if both columns have numbers. The field names are "1st Week" and "2nd Week". I entered this formula =IF('2nd Week'="","",'1st Week'-'2nd Week'), which I thought should work, but I'm getting the 1st Week value in rows where the 2nd Week column is blank. Thanks for any help.

    Ken

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,257

    Re: Pivot table formula problem

    Do you need to distinguish between the second week total being 0 and it being blank?
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    06-10-2014
    Location
    Kansas City, MO
    MS-Off Ver
    Excel 97
    Posts
    26

    Re: Pivot table formula problem

    No, the 2nd Week column has either a positive value or is blank.

  4. #4
    Registered User
    Join Date
    06-10-2014
    Location
    Kansas City, MO
    MS-Off Ver
    Excel 97
    Posts
    26

    Re: Pivot table formula problem

    The below formula works for me since I'm looking for high positive values.
    =IF('1st Week'+'2nd Week'='1st Week',0,'1st Week'-'2nd Week')

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,257

    Re: Pivot table formula problem

    You should also be able to just test for 0 then:

    =IF('2nd Week'=0,"",'1st Week'-'2nd Week')

+ 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. Replies: 4
    Last Post: 02-19-2018, 06:34 AM
  2. Replies: 6
    Last Post: 01-24-2017, 06:56 PM
  3. Pivot table problem - how to relate 3 sheets' data into 1 pivot table?
    By GRG Stevan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-14-2015, 06:12 AM
  4. VBA Pivot Table: Problem with pivot item visibility
    By rotown21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-22-2013, 03:56 AM
  5. Replies: 6
    Last Post: 03-20-2013, 09:37 AM
  6. Pivot table problem
    By KikiMarie in forum Excel General
    Replies: 2
    Last Post: 11-04-2005, 06:40 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