+ Reply to Thread
Results 1 to 3 of 3

Pivot table - calculated field using 'IF'

  1. #1
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Pivot table - calculated field using 'IF'

    Hi,

    I can't seen to find much written about this.

    In a pivot table I have field (named 'Removed'), that exists in the underlying database with a 'Y' or 'N' in each record. I need to be able to count and sum the number of 'Y's' so that I can subtotal against a third field.

    The underlying database is on a SQL server elsewhere so I don't want to add a field to the original data, and I guess the calculated Field functionality is what I want. However try as I may I can't get the PT to accept it.

    I've tried an =IF(Removed="Y",1,0) and =COUNTIF(Removed,"Y") all to no avail

    Any ideas anyone?

    Usual TIA

  2. #2
    Forum Contributor
    Join Date
    07-10-2007
    Location
    Portland, OR USA
    Posts
    135
    Hard to tell without an example... where is the remove field in your pivot table? That is column heading, row heading, data, etc?

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    Thanks for the response. It was actually a column header. But I think I've sussed the problem. PTs seem particularly sensitive. I noticed that a date column that I was trying to group against had some blank cells in the full data set. Usual sort of problem. I tested the functionality on a small subset of the on-line database, and of course had no problems, so naively assumed that the whole database was consistent, and I was tearing my hair out, (or what's left of it) trying to understand the problem. Once I sorted out the blank data everything was OK.

    Although oddly PTs as i say seem sensitive. Haven't fixed the missing dates it wasn't sufficient just to try the grouping again. I first had to refresh the data then regroup.

    Thanks again for your input

+ 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. Problem with calculated field in Pivot table
    By BigPat in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-27-2008, 04:25 AM
  2. Calculated field of Pivot Table
    By vandanavai in forum Excel General
    Replies: 1
    Last Post: 03-21-2008, 01:37 PM
  3. Pivot table calculated field question
    By no dice in forum Excel General
    Replies: 0
    Last Post: 12-14-2007, 03:40 PM
  4. Pivot Table Calculated Field
    By joprotus in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-02-2007, 05:52 AM
  5. Calculated Field In Pivot Table
    By nailers67 in forum Excel General
    Replies: 0
    Last Post: 04-02-2007, 08:15 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