+ Reply to Thread
Results 1 to 4 of 4

Using a distinctcount of days within a week as an operator in a formula within Pivot-Table

  1. #1
    Registered User
    Join Date
    10-08-2019
    Location
    Norway
    MS-Off Ver
    MS Office 2016
    Posts
    2

    Using a distinctcount of days within a week as an operator in a formula within Pivot-Table

    Hi.
    I am using MS Excel 2016
    I've done some searching in the forums, but I can never seem to find something quite similar to my problem.

    I have a dataset consisting of several entries divided amongst a couple of cars per day.

    The data includes:
    • Entry-number
    • Date
    • Car used
    • Timestamps for each status change of the journey
    • + a ton of irrelevant data to my question.

    I want to make a report of the effective usage of each car. And I want this as a percentage of time available for the different cars. The availability varies from car to car.

    So far I've made a pivot-table (which is great for displaying relevant information), but I am stumped as to how I can make a weekly report for the coverage of the cars. The table adds up the different entries for each day rather beutifully, and with the use of IF-formulas, I've managed to calculated the time in service divided by available time.

    My problems arise when I try to consolidate this in periods of one week. The calculations are a simple thing to alter, but if there are days where the car has not been available during a certain week, my current formulas are not taking those into account, and I get a faulty coverage-report.

    Does anyone know a way I can distinctly count the number of unique days within a period in a pivot-table and then use the distinct count within a field-calculation to get the right number of days in my formulas divider?
    Alternatly, if anyone has a better idea of how to approach the problem, I am open to suggestions.



    with regards
    Kai

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Using a distinctcount of days within a week as an operator in a formula within Pivot-T

    Sometimes a column of 1/countifs(…..) will suffice

    if a is car and b is date and a car was driven 3 times on a day 1/countifs(a:A,a1,b:B,b1) will give a third, but will sum to 1 in other calculations


    Without an attachment it is hard to be specific

  3. #3
    Registered User
    Join Date
    10-08-2019
    Location
    Norway
    MS-Off Ver
    MS Office 2016
    Posts
    2

    Re: Using a distinctcount of days within a week as an operator in a formula within Pivot-T

    I will try this when I am able. Thank you.
    I am guessing countif on dates will function much in the same way

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Using a distinctcount of days within a week as an operator in a formula within Pivot-T

    Yes but you may wish to not include the dates, as you would wish this number to be the full number of days and it will appear in your pivot table anyway

+ 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: 1
    Last Post: 12-05-2018, 11:15 AM
  2. [SOLVED] distinctcount in regular pivot tables
    By stephme55 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-27-2016, 03:23 AM
  3. Replies: 1
    Last Post: 04-21-2014, 12:59 PM
  4. Pivot Table filters with OR operator
    By limalf in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 11-27-2013, 08:12 AM
  5. Replies: 5
    Last Post: 02-09-2012, 12:05 PM
  6. Pivot table - days of the week sequence
    By dalewms2 in forum Excel General
    Replies: 3
    Last Post: 10-19-2011, 09:29 AM
  7. Pivot table soustraction operator
    By RGO in forum Excel General
    Replies: 0
    Last Post: 03-16-2006, 11:10 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