+ Reply to Thread
Results 1 to 7 of 7

Thread: Subtotaling Working unique Days

  1. #1
    Registered User
    Join Date
    08-10-2007
    Posts
    91

    Subtotaling Working unique Days

    Hi,

    i attached a sample.. could you please help me.. i cant seem to figure out the formula..

    i want to count only the working days from List, say if i have same date 5 or 10 times in range, it should counted as one day.
    i also tried count or counta formulas, didnt seem to work.

    I need a solution for subtotal.. if i filter a month or different criteria it should show at the top the counted days..
    also the pivot dont seem to work aswell..

    Thanks for helping me

    happy new year
    Attached Files Attached Files
    Last edited by Sultix; 01-06-2012 at 10:55 PM.

  2. #2
    Forum Guru Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007
    Posts
    3,523

    Re: Subtotaling Working unique Days

    On Sheet1, add this formula into a helper column (call it Unique Count or whatever)

    =IF(COUNTIF($B$4:B4,B4)>1,0,COUNTIF($B$4:B4,B4))

    Copy it down the column

    Reset the Pivot Table to include the new column, then add the Unique Count to the Values field and change the field setting to SUM (not count).

    Or to use the SUBTOTAL function with the filter on sheet1,

    =SUBTOTAL(9,J4:J223)

    Where column-J is the helper column
    Last edited by Palmetto; 12-30-2011 at 08:28 PM.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Valued Forum Contributor alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Lake County, Illinois
    MS-Off Ver
    MS Office 2010, 2007 and 2002
    Posts
    1,165

    Re: Subtotaling Working unique Days

    Look at this thread in another forum for a solution.

    http://www.mrexcel.com/forum/showthread.php?t=70835

  4. #4
    Valued Forum Contributor dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    New Delhi, India
    MS-Off Ver
    Excel 1997, 2000, XP, 2003, 2007, 2010
    Posts
    2,406

    Re: Subtotaling Working unique Days

    Hi sultix,

    A very happy new year to you and your loved ones .. cheers

    See the attached file where I have given a try solving your query. Let me know if this helps.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    Attached Files Attached Files
    DILIPandey
    +919810929744
    dilipandey@gmail.com

  5. #5
    Registered User
    Join Date
    10-13-2010
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Subtotaling Working unique Days

    I would suggest:

    1 - add a SUBTOTAL for each line on your table (hide column as necessary)

    K4: =SUBTOTAL(2,B4)
    copied down to K223

    2 - use a single SUMPRODUCT with COUNTIFS (possible given your version)

    E1: =SUMPRODUCT($K$4:$K$223/COUNTIFS($K$4:$K$223,$K$4:$K$223&"",$B$4:$B$223,$B$4:$B$223&""))

    The above would generate 13 | 8 | 9 for Sep, Oct & Nov respectively - and would work regardless of which filters you apply (i.e not exclusive to month selection).
    Last edited by XLent; 12-31-2011 at 01:57 AM.

  6. #6
    Valued Forum Contributor Haseeb A's Avatar
    Join Date
    05-24-2011
    Location
    India | Kwt
    MS-Off Ver
    2007
    Posts
    1,460

    Re: Subtotaling Working unique Days

    This Array Formula will give the count of unique in filtered range.

    =SUM(SIGN(FREQUENCY(IF(SUBTOTAL(2,OFFSET(B4,ROW(B$4:B$223)-ROW(B4),)),B$4:B$223),B$4:B$223)))

    Or, as Palmetto said, use this formula in a helper column & use as SUBTOTAL(9,...) also add this column in pivot table.

    =(COUNTIF(B$4:B4,B4)=1)+0
    HTH; Haseeb

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Forum Rules & How to Mark a thread as SOLVED

  7. #7
    Registered User
    Join Date
    08-10-2007
    Posts
    91

    Re: Subtotaling Working unique Days

    Hi fellow contributors,

    all four methods works perfectly.. i have now so many different methods for different methods or results

    i never thought about helper column, there is also another way with =IF(B4=B5;0;1) in helper column, and then sum it with subtotal formula.



    thanks for all your help..

    @haseeb, your formula looks similar to dilipantey, i will try that tomorrow

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0