+ Reply to Thread
Results 1 to 11 of 11

Subtracting two pivot table columns based on a count

  1. #1
    Registered User
    Join Date
    04-30-2013
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Subtracting two pivot table columns based on a count

    I'm attempting to create a pivot table to show the count of created tickets, and the count of resolved tickets and the backlog between the two.

    I have the pivot table setup right now so that the Rows are the Ticket Queue names, and there are two columns, Count of Created and Count of Resolved, which gives me the total number of tickets created in that queue on a particular month/week/day/whatever, and the total number of tickets resolved in that same time frame.

    The Created and Resolved fields are dates in my datasheet. The pivot table currently looks like this:

    Please Login or Register  to view this content.
    I would like to add a column for "Backlog" which would simply give me the difference in the count. Currently if i add a calculated field and use the formula =Created-Resolved, i get very large or negative numbers, i'm assuming this is because the field is a date field and it's actually subtracting the time between the two columns rather than the count.

    I'd like to see my table like this:

    Please Login or Register  to view this content.
    I could then add in other data such as month and see the backlog of tickets from month to month. I'd also like this data to be easily updatable, because this information will be processed weekly, monthly and sometimes daily so if i could create the table to display the info i can just update the datasheet and refresh the pivot table to display the new information.


    Any help would be greatly appreciated.

    Thank you,
    Tyler

  2. #2
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Re: Subtracting two pivot table columns based on a count

    Hello Tyler, welcome to the fourm. How about sharing a sample PT.
    Best Regards/VKS

  3. #3
    Registered User
    Join Date
    04-30-2013
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Subtracting two pivot table columns based on a count

    Sure thing, here you go.

    Demo_PivotTable.xlsx

  4. #4
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Re: Subtracting two pivot table columns based on a count

    As i go through your demo file, please check the attached file that i worked on while waiting for the sample file.
    Please do let me know if this is what you want.
    Best Regards/VKS
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-30-2013
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Subtracting two pivot table columns based on a count

    Ummmm, that's sort of what I'd like, perhaps the demo file i attached will help illustrate what i'm looking for.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Subtracting two pivot table columns based on a count

    I reckon you'll need two new columns in the source data that return 1 if the date field is populated for created/resolved then you can use sum on these fields in the pivot and subtract one from the other as a calculated field
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  7. #7
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Re: Subtracting two pivot table columns based on a count

    Enjoyed doing it. Attached, is the pivot table the way you would want to see it. Its bit too late here keeping in mind working day tomorrow. Send me your questions if you have any and i will be happy to try and answer them.
    Best Regards/VKS
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    08-05-2014
    Location
    Moscow, Russia
    MS-Off Ver
    2013
    Posts
    1

    Re: Subtracting two pivot table columns based on a count

    Hello everyone.

    As far as I see in the attached file, final calculation is done based on additional pivot. Something like: Data -> Pivot 1 to calculate Counted values -> pivot 2 to calculate subtraction between Counted values.

    But is there any way to add this subtracting int the pivot 2. So it will contain something like "= count of value1 - count of value 2"

  9. #9
    Forum Contributor
    Join Date
    07-07-2019
    Location
    london
    MS-Off Ver
    2013
    Posts
    105

    Re: Subtracting two pivot table columns based on a count

    Hi,
    this is the exact problem i have in that i have a sum of count in the column of one row and a another count sum of count in another column and i wish to subtract one from the other.
    VKS has shown the answer in the form of a pivot. but how was it done so i can apply it to my pivot table.
    any help is very much appreciated.
    thanks

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,791

    Re: Subtracting two pivot table columns based on a count

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original. Please start a new thread - See Forum rule #4

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  11. #11
    Registered User
    Join Date
    07-04-2019
    Location
    Malaysia
    MS-Off Ver
    MS Office Standard 2016
    Posts
    1

    Re: Subtracting two pivot table columns based on a count

    Hi tsadams23,

    I believe that it is better to rearrange the input data. Make Date as a field. More analysis would be possible by doing this.

    Thanks

    Attachment 631276

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