+ Reply to Thread
Results 1 to 3 of 3

Sum, If, Subtotal Formula

  1. #1
    Registered User
    Join Date
    11-23-2012
    Location
    Oopa
    MS-Off Ver
    Excel 2007
    Posts
    2

    Sum, If, Subtotal Formula

    Having the following situation:

    A B C
    Yes No Yes
    Yes Yes Yes
    No No No

    I am trying to count the number of rows that contain at least one time "Yes". In order to do so I have the following formula: =SUM(IF(FREQUENCY(IF(A1:C3="Yes";ROW(A1:C3))>0;1)) as an array.

    Now this data is going to be filtered, so I need to move this into a subtotal formula, but I cannot seem to get this working. The results is never 2 in this example.

    Help is greatly appriciated, because it took me the whole afternoon to end up with nothing

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699

    Re: Sum, If, Subtotal Formula

    Is your formula missing something? It doesn't work for me.....

    Try this version for only counting visible rows after filtering, assumes that all cells are populated as per your example

    =SUM(IF(FREQUENCY(IF(A1:C3="Yes";IF(SUBTOTAL(3;OFFSET(A1;ROW(A1:A3)-ROW(A1);0));ROW(A1:C3)));ROW(A1:C3));1))

    confirmed with CTRL+SHIFT+ENTER
    Audere est facere

  3. #3
    Registered User
    Join Date
    11-23-2012
    Location
    Oopa
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Sum, If, Subtotal Formula

    Perfect! Works almost the way I wanted it: only changed in OFFSET the ;1 in the end in ;0;1 and then it worked Thanks!!

+ 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.6.0 RC 1