+ Reply to Thread
Results 1 to 7 of 7

CountIf on Text in cells if used not more than once, then sum the results.

  1. #1
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    CountIf on Text in cells if used not more than once, then sum the results.

    Count if:

    I am trying to count values in Column A where if the values are used more than once, (i.e. Billy A), the total desired result should be in cell g1, where total count in of all values in column a, which are not used more than once. So total count should be 3, as in cell g1, where it is counting the values in column a, which were not used more than once.

    Then using values in Column B, these should only sumif, the values in column A, which were not counted more than once, so in this case, it should only add up, cells b3..b5, because these were the values in column a, not counted.

    Desired result in columns g1 and g2.


    Thanks in Advance.
    Attached Files Attached Files

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: CountIf on Text in cells if used not more than once, then sum the results.

    Still waiting for your feed back in this (your)thread.........

    http://www.excelforum.com/excel-form...lue-error.html
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: CountIf on Text in cells if used not more than once, then sum the results.

    Try these formulas in G1 and G2 respectively

    =SUMPRODUCT((COUNTIF(A2:A6,A2:A6)=1)+0)

    and

    =SUMPRODUCT((COUNTIF(A2:A6,A2:A6)=1)+0,B2:B6)
    Audere est facere

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: CountIf on Text in cells if used not more than once, then sum the results.

    Try this:
    =SUMPRODUCT(--(COUNTIF($A$2:$A$6,$A$2:$A$6)=1))
    and
    =SUMPRODUCT(--(COUNTIF($A$2:$A$6,$A$2:$A$6)=1)*$B$2:$B$6)
    Quang PT

  5. #5
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    Re: CountIf on Text in cells if used not more than once, then sum the results.

    Thanks daddylonglegs & bebo021999 both solutions worked. Appreciate your help


    Trying to understand...


    daddylonglegs..why add the + 0?

    Bebo...
    what does -- mean when using sumproduct?

    I tried without the -- in the 2nd formula you gave and it still worked, when removing the -- in first formula it made it 0. so trying to understand...

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: CountIf on Text in cells if used not more than once, then sum the results.

    +0 and -- both do the same thing here, they "co-erce" arrays of TRUE/FALSE values to 1/0 values that SUMPRODUCT can process, e.g.

    COUNTIF(A2:A6,A2:A6)=1

    produces an array like this

    {FALSE;TRUE;TRUE;TRUE;FALSE}

    adding zero changes it to

    {0;1;1;1;0}

    In bebo's 2nd formula the -- isn't required because when you multiply the array with * that implicitly co-erces the TRUE/FALSE values

  7. #7
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    Re: CountIf on Text in cells if used not more than once, then sum the results.

    Thanks daddylonglegs. That is starting to make sense...

+ 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