+ Reply to Thread
Results 1 to 6 of 6

CountIF Integrated in Getpivotdata

Hybrid View

  1. #1
    Registered User
    Join Date
    10-24-2017
    Location
    Florida
    MS-Off Ver
    2013
    Posts
    3

    CountIF Integrated in Getpivotdata

    Dear all,

    I'm new here and decided to join as I'm always able to find some great answers in this forum. However, I'm racking my brain to try to figure out an easy approach to getting a countif nested in a getpivotdata or similar and haven't found anything.

    I'm trying to count the amount of "shifts" that fall between intervals. My pivot looks similar to below (maybe remove End Shift Time and include duration of shift...):

    ID DD/MM/YY
    Start Shift Time End Shift Time
    1 9:00 17:30
    2 12:30 21:00
    3 8:00 16:30
    4 8:00 16:30
    5 9:00 17:30
    6 10:30 19:30


    My intervals are as below:
    7:00:00
    7:30:00
    8:00:00
    8:30:00
    9:00:00
    9:30:00
    10:00:00
    10:30:00
    11:00:00
    11:30:00
    12:00:00
    12:30:00
    13:00:00
    13:30:00
    14:00:00
    14:30:00
    15:00:00
    15:30:00
    16:00:00
    16:30:00
    17:00:00
    17:30:00
    18:00:00
    18:30:00
    19:00:00
    19:30:00
    20:00:00
    20:30:00


    I managed to use the following formula to get the data I want: =COUNTIF('Shift StartEND Pivot'!HZ$8:HZ$152,">"&$B3)-COUNTIF('Shift StartEND Pivot'!HY$8:HY$152,">"&$B3)

    However, this is time consuming as I need to do this for each day for a total of 3 months at a time. Attached example.

    Thank you in advance for help!

    Best,
    JZoSoPP
    Attached Files Attached Files

  2. #2
    Forum Contributor shivya's Avatar
    Join Date
    08-19-2017
    Location
    Delhi, India
    MS-Off Ver
    2013
    Posts
    240

    Re: CountIF Integrated in Getpivotdata

    Mention your desired result as well.
    To attach worksheet Go advanced -> Manage attachments -> Choose file -> Upload
    Don't forget to Mention your desired result in the sheet..
    There should be sample data only, a lot of data creates confusion.

    Thanks & Regards

    Shivya

    http://excelvbatipsforbeginners.blogspot.in/

  3. #3
    Registered User
    Join Date
    10-24-2017
    Location
    Florida
    MS-Off Ver
    2013
    Posts
    3

    Re: CountIF Integrated in Getpivotdata

    I need to figure out the count of shifts per interval per day for 3 months.

    E.g. On Monday the 30th of October, I have 3 shifts starting at 9:00 to 5:30pm and 1 shift starting at 12:30 - 9:00pm - then count how many of these shifts are in each 30min interval. In this example, I should get 3 counts at 9AM, 3 counts at 9:30AM......4 counts at 12:30pm......1 count at 5:30pm...

    The Countif formula works, but its not efficient when running on a 3month time range, and when you have different services.

    I hope this clarifies

  4. #4
    Registered User
    Join Date
    10-24-2017
    Location
    Florida
    MS-Off Ver
    2013
    Posts
    3

    Re: CountIF Integrated in Getpivotdata

    Anyone have any leads?

  5. #5
    Forum Contributor shivya's Avatar
    Join Date
    08-19-2017
    Location
    Delhi, India
    MS-Off Ver
    2013
    Posts
    240

    Re: CountIF Integrated in Getpivotdata

    Hello jzosopp,

    In which column you are trying to place your formula for 30th Oct. We are not clear Please mention your desired result in sheet.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,999

    Re: CountIF Integrated in Getpivotdata

    Hello jzosopp and Welcome to Excel Forum.
    This is a low tech proposal.
    Put a helper table at the bottom of the 'Pivot Values' sheet.
    Column A of the table would be populated by the time intervals.
    Columns B:IU would be populated by the formula:
    Formula: copy to clipboard
    =IF(C$6="",COUNTIF('Pivot Values'!C$9:C$76,">"&$A82)-COUNTIF('Pivot Values'!B$9:B$76,">"&$A82),"")

    On the 'Actual Staff' sheet the values are taken from the helper table using the formula:
    Formula: copy to clipboard
    =INDEX('Pivot Values'!$B$82:$IU$109,MATCH($B2,'Pivot Values'!$A$82:$A$109,0),MATCH(C$1,'Pivot Values'!$B$6:$IU$6,0))

    I imagine that some modification will need to be made to accommodate the different types of staff (GNR ESP, GNR FRE etc.) however perhaps this will get you started.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Pivot table integrated survey
    By umang2382 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 03-01-2016, 01:33 PM
  2. TextBox integrated Chart ?
    By HerryMarkowitz in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 07-09-2015, 01:07 AM
  3. [SOLVED] GETPIVOTDATA – How to force getpivotdata to accept missing data
    By scottc_00 in forum Excel Formulas & Functions
    Replies: 39
    Last Post: 02-11-2015, 03:23 PM
  4. [SOLVED] IF & VLOOKUP integrated !
    By sonu1975 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-17-2014, 09:02 AM
  5. COUNTIF function integrated with IF function
    By mamuka12 in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 03-22-2013, 06:44 PM
  6. [SOLVED] COUNTIF integrated with a MATCH or VLOOKUP
    By jshaw82 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-22-2013, 05:48 PM
  7. Email Integrated to Excel
    By Bob Ogdon in forum Excel General
    Replies: 0
    Last Post: 08-21-2006, 08:20 AM

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