+ Reply to Thread
Results 1 to 6 of 6

Frequency on filtered array

  1. #1
    Registered User
    Join Date
    12-29-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2003
    Posts
    3

    Frequency on filtered array

    Hi,

    I'm struggling to get the following formulas written. Would appreciate any help.
    1. Number of unique Accounts per Year; I manage to get the unique Accounts but cannot filter per year... =SUM(IF(FREQUENCY(B2:B100;B2:B100)>0;1;0))
    2. Number of unique new Accounts per Year (So Accounts that didn't show up in all _previous_ Years)
    3. The Revenue these new Accounts accumulated in the year (they started)

    A B C
    Date Account Revenue
    ... ... ...
    2012-12-17 10265 793,8
    2012-12-17 10265 -476,28
    2012-12-20 6030 -187,5
    2012-12-20 6030 103,6
    2012-12-28 13463 103,6
    2013-01-11 13483 647,5
    2013-01-29 13483 103,6
    2013-02-07 13454 103,6
    2013-02-07 9177 673,4
    2011-11-25 13464 178,2
    2013-04-18 13464 1113,75
    ... ... ...

    Much appreciated!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Frequency on filtered array

    Try this for the number of unique accounts per year...

    Data Range
    A
    B
    C
    D
    E
    F
    1
    Date
    Account
    Revenue
    -----
    Year
    Unique count
    2
    12/17/2012
    10265
    793.8
    2011
    1
    3
    12/17/2012
    10265
    -476.28
    2012
    3
    4
    12/20/2012
    6030
    -187.5
    2013
    4
    5
    12/20/2012
    6030
    103.6
    6
    12/28/2012
    13463
    103.6
    7
    1/11/2013
    13483
    647.5
    8
    1/29/2013
    13483
    103.6
    9
    2/7/2013
    13454
    103.6
    10
    2/7/2013
    9177
    673.4
    11
    11/25/2011
    13464
    178.2
    12
    4/18/2013
    13464
    1113.75


    This array formula** entered in F2 and copied down:

    =SUM(IF(FREQUENCY(IF(YEAR(A$2:A$12)=E2,B$2:B$12),B$2:B$12),1))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    I'm not sure what you want for 2 and 3. Tell us/show us what results you expect for 2 and 3.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    12-29-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Frequency on filtered array

    Many thanks. Works perfect!

    Agree. questions 2 and 3 aren't very clear.

    On 2: Builds on the results of 1. I would like to know the number of unique Accounts in a certain Year that are below and above a predefined limit. E.g. the number of unique Accounts in 2013 that are below 14000, but above 13000.

    On 3: Builds on the resuklts of 2. I would like to know the total Revenue that corresponds with the accounts resulting from 2 (so, per year).

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Frequency on filtered array

    Maybe these...

    Both are array formulas**.

    Unique accounts in year 2013 between 13000 and 14000 (inclusive):

    E2 = 2013
    F2 = 13000
    G2 = 14000

    =SUM(IF(FREQUENCY(IF(YEAR(A2:A12)=E2,IF(B2:B12>=F2,IF(B2:B12<=G2,B2:B12))),B2:B12),1))

    Total revenue for the above:

    =SUM(IF(FREQUENCY(IF(YEAR(A2:A12)=E2,IF(B2:B12>=F2,IF(B2:B12<=G2,B2:B12))),B2:B12),B2:B12))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

  5. #5
    Registered User
    Join Date
    12-29-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Frequency on filtered array

    Thanks for the help! Is exactly what I needed!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Frequency on filtered array

    You're welcome. Thanks for the feedback!

    If your question has been answered please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools>Mark this thread as solved.

+ 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. Frequency with Subtotal (counting only filtered numbers)
    By yuuvo in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 10-17-2014, 09:27 PM
  2. [SOLVED] Counting Frequency of Filtered Data
    By tom in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-17-2014, 09:25 PM
  3. XLS Array - Unique Value and Frequency?
    By markp99 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-11-2012, 05:48 PM
  4. Replies: 1
    Last Post: 08-31-2005, 02:05 PM
  5. [SOLVED] Determine Frequency in Filtered List
    By Michael in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-10-2005, 04:06 PM

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