+ Reply to Thread
Results 1 to 3 of 3

Calculate Subtotal with two conditions on filtered data only

  1. #1
    Registered User
    Join Date
    04-30-2020
    Location
    TX
    MS-Off Ver
    2013
    Posts
    2

    Calculate Subtotal with two conditions on filtered data only

    Hi,

    I am attempting to calculate subtotals using two conditions. In my worksheet I am using the "Email" column to count the unique employees. Within that count, I also need the number of employees that have "Years in Company" greater than ten. Filtered data only

    My issue is:

    1) I would like to use the ID column to count the unique employees instead of the email address (the ID is stored as text) and store that result in B15
    2) Out of the unique employee count as stated above, I need to calculate the employees in that have greater than 10 "Years in Company" and store the value in B12 (*Years in company is stored as text)

    I was able to get the formula to count the unique employees by email:

    =SUM(--(FREQUENCY(IF(SUBTOTAL(3, OFFSET(Table1[Email], MATCH(ROW(Table1[Email]), ROW(Table1[Email]))-1, 0, 1)), COUNTIF(Table1[Email], "<"&Table1[Email]), ""), COUNTIF(Table1[Email], "<"&Table1[Email]))>0))

    Thanks so much!

    Jelx
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Calculate Subtotal with two conditions on filtered data only

    Please try at

    B12
    =COUNT(1/FREQUENCY(IF(SUBTOTAL(3,OFFSET($B$1,ROW(Table1)-ROW($B$1),))*(--Table1[Years in Company]>10),MATCH(Table1[Email],Table1[Email],)),ROW(Table1)-ROW($B$1)))

    B15
    =COUNT(1/FREQUENCY(IF(SUBTOTAL(3,OFFSET($A$1,ROW(Table1)-ROW($B$1),)),-Table1[ID]),-Table1[ID]))
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-30-2020
    Location
    TX
    MS-Off Ver
    2013
    Posts
    2

    Re: Calculate Subtotal with two conditions on filtered data only

    Hi,

    Yes it works perfectly. You are awesome. Thank you so, so very much.

+ 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. [SOLVED] Aggregate based on filtered data (subtotal?)
    By Median in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-02-2018, 05:03 PM
  2. [SOLVED] Subtotal of filtered data with one criteria
    By HaroonSid in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-24-2017, 09:22 AM
  3. [SOLVED] Calculate SUBTOTAL of a SUMPRODUCT within a filtered range
    By Lucille Boshoff in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-15-2016, 08:45 AM
  4. [SOLVED] How can I calculate the subtotal for filtered cells that meet certain criteria?
    By jasond1992 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-28-2015, 09:23 PM
  5. [SOLVED] Forumulas for Filtered Data =SUBTOTAL(A1:A2) Etc
    By Ben1985 in forum Excel General
    Replies: 3
    Last Post: 09-03-2013, 10:39 AM
  6. Subtotal - Delete zero Subtotal and prior rows that calculate to that zero Subtotal
    By Whatsherface in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2012, 08:37 PM
  7. Subtotal function with Filtered Data
    By RonB in forum Excel General
    Replies: 3
    Last Post: 08-12-2005, 06:05 PM

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