• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Building multi-field dated evaluation in a Pivot Table

Steve Marchesi

New Member
I've been asked to add an additional pivot table to an existing report that I produce weekly that measures our Service contract renewal Quote delivery effectiveness against customer's expiration dates. See the new pivot table I've started at bottom right, outlined in yellow highlight on the tab named "Overview" Need assistance on how to construct these time interval measurements using Pivot table functionality. Data column I'm keying off is named "Quote Dely Days to Exp" on data tab (I used Networkdays function to calculate).
 

Attachments

  • CSA Weekly Report11.06.14 FY15 w-quote dely to exp.xlsx
    795.2 KB · Views: 5
Hi Steve. Because you are grouping things into uneven buckets, then the easiest way to do this is to add a formula into your source data that categorises the data into the appropriate group, and then bring this new field into your pivot.

Rather than use a nested IF statement to do this - which would be pretty complicated given the 9 different groups - it's far easier to use a Lookup table to group things. To do this, we need to sort the Lookup table in descending order, and use the MATCH function with a Match_type argument of -1, which looks up the smallest value greater than or equal to the lookup value.

I've done this in the attached file. I've also turned your PivotTable Source data into an Excel Table - which is something i ALWAYS do - so that when you add new records, then they will automatically show up in the PivotTable next time you refresh it (i.e. you don't have to use the 'Change Data Source' button to include them). So the below screenshots and formulas use Excel Table Notation. If you're unfamilar, then give Google a spin. I'll also be covering stuff like this in the book I'm working on - Excel for Superheroes and Evil Geniuses.

A slight complication is the fact that you also want to see items that happen to be at the expiry date. To accommodate this, we need a grouping table that looks like this:

15-11-2014 11-44-29 a-m-.gif

(Note that I might have the Text entries the wrong way around...I haven't studied your requirements that closely. This is easily fixed...just change the wording in the 'Text' column.)

I've given that table the name 'Groups'. The formula we use to categorize your source data based on that table looks like this:
=INDEX(Groups[Text],MATCH([@[Quote Dely Days to Exp]],Groups[Boundary],-1))

Here's a screenshot that shows the result:
15-11-2014 11-54-27 a-m-.gif


See the attached file.
 
Hi Steve. Because you are grouping things into uneven buckets, then the easiest way to do this is to add a formula into your source data that categorises the data into the appropriate group, and then bring this new field into your pivot.

Rather than use a nested IF statement to do this - which would be pretty complicated given the 9 different groups - it's far easier to use a Lookup table to group things. To do this, we need to sort the Lookup table in descending order, and use the MATCH function with a Match_type argument of -1, which looks up the smallest value greater than or equal to the lookup value.

I've done this in the attached file. I've also turned your PivotTable Source data into an Excel Table - which is something i ALWAYS do - so that when you add new records, then they will automatically show up in the PivotTable next time you refresh it (i.e. you don't have to use the 'Change Data Source' button to include them). So the below screenshots and formulas use Excel Table Notation. If you're unfamilar, then give Google a spin. I'll also be covering stuff like this in the book I'm working on - Excel for Superheroes and Evil Geniuses.

A slight complication is the fact that you also want to see items that happen to be at the expiry date. To accommodate this, we need a grouping table that looks like this:

View attachment 12861

(Note that I might have the Text entries the wrong way around...I haven't studied your requirements that closely. This is easily fixed...just change the wording in the 'Text' column.)

I've given that table the name 'Groups'. The formula we use to categorize your source data based on that table looks like this:
=INDEX(Groups[Text],MATCH([@[Quote Dely Days to Exp]],Groups[Boundary],-1))

Here's a screenshot that shows the result:
View attachment 12862


See the attached file.



Jeffrey,

hanks for the reply to my request. The end of your message indicated a file attachment- but I didn't see any. Had you meant to send my original file that you modified back to me?

Thanks,

Steve
 
I'm not sure if I attahed file. I'll try again.
 

Attachments

  • Grouping due dates_20141115 v2.xlsx
    762 KB · Views: 2
  • Grouping due dates_20141115 v2.xlsx
    762 KB · Views: 3
Back
Top