+ Reply to Thread
Results 1 to 3 of 3

Counting Column B entries, excluding duplicate criteria in column A.

  1. #1
    Registered User
    Join Date
    03-11-2020
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    8

    Counting Column B entries, excluding duplicate criteria in column A.

    Hello,

    I am making an investment spreadsheet and I need to count how many stocks I have a dividend reinvestment plan (DRP) with.

    Here is an example of what I am working with:
    Sample.png

    Stocks that are listed as "Yes" in column B will be counted as 1 dividend reinvestment plan.

    I want to only count the same stock ONCE. For example, in this case, Rio Tinto will count as 1 dividend reinvestment plan, even though there are 2 Rio Tinto entries with "Yes."
    This is because it is just repeated (I have purchased the same stock multiple times, but I am still recording this listing as being in 1 dividend reinvestment plan because it is the same stock).

    I need this formula to count through the entire columns for A and B, not just this table. This is just an example. I would like the total DRP count to display in a single cell.

    I have attached a Sample workbook in this thread. Please note that this sample does use live data to display the stock names and was made using the latest version of Excel for Office 365.

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Counting Column B entries, excluding duplicate criteria in column A.

    A
    B
    C
    D
    E
    1
    CODE DRP COUNT CODE
    2
    Apple Inc (XNAS:AAPL)
    no
    1
    Rio Tinto Ltd (XASX:RIO)
    3
    Microsoft Corp (XNAS:MSFT)
    No
    4
    Tesla Inc (XNAS:TSLA)
    No
    5
    Rio Tinto Ltd (XASX:RIO)
    Yes
    6
    Cochlear Ltd (XASX:COH)
    No
    7
    CSL Ltd (XASX:CSL)
    No
    8
    Apple Inc (XNAS:AAPL)
    No
    9
    Tesla Inc (XNAS:TSLA)
    No
    10
    Rio Tinto Ltd (XASX:RIO)
    Yes



    D2=SUM(IF(FREQUENCY(IF($B$2:$B$100="Yes",MATCH(A2:A100,A2:A100,0)),ROW(A2:A100)-ROW(A2)+1),1))

    Control+shift+enter


    E2=IFERROR(INDEX($A$2:$A$100,SMALL(IF(FREQUENCY(IF($B$2:$B$100="yes",MATCH($A$2:$A$100,$A$2:$A$100,0)),ROW($A$2:$A$100)-ROW($A$2)+1),ROW($A$2:$A$100)-ROW($A$2)+1),ROWS($A$2:A2))),"")


    Control+shift+enter

    copy down

  3. #3
    Registered User
    Join Date
    03-11-2020
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    8

    Re: Counting Column B entries, excluding duplicate criteria in column A.

    Quote Originally Posted by CARACALLA View Post
    A
    B
    C
    D
    E
    1
    CODE DRP COUNT CODE
    2
    Apple Inc (XNAS:AAPL)
    no
    1
    Rio Tinto Ltd (XASX:RIO)
    3
    Microsoft Corp (XNAS:MSFT)
    No
    4
    Tesla Inc (XNAS:TSLA)
    No
    5
    Rio Tinto Ltd (XASX:RIO)
    Yes
    6
    Cochlear Ltd (XASX:COH)
    No
    7
    CSL Ltd (XASX:CSL)
    No
    8
    Apple Inc (XNAS:AAPL)
    No
    9
    Tesla Inc (XNAS:TSLA)
    No
    10
    Rio Tinto Ltd (XASX:RIO)
    Yes



    D2=SUM(IF(FREQUENCY(IF($B$2:$B$100="Yes",MATCH(A2:A100,A2:A100,0)),ROW(A2:A100)-ROW(A2)+1),1))

    Control+shift+enter


    E2=IFERROR(INDEX($A$2:$A$100,SMALL(IF(FREQUENCY(IF($B$2:$B$100="yes",MATCH($A$2:$A$100,$A$2:$A$100,0)),ROW($A$2:$A$100)-ROW($A$2)+1),ROW($A$2:$A$100)-ROW($A$2)+1),ROWS($A$2:A2))),"")


    Control+shift+enter

    copy down
    This works!! You are amazing, thank you!!

+ 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. Counting entries in column then creating a new column with single entry
    By Sir Charlesss in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 08-24-2017, 12:49 PM
  2. [SOLVED] Highlight duplicate rows excluding column and vice versa another column
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-07-2016, 02:22 PM
  3. [SOLVED] Remove duplicate entries from one column and output it into another column using formulas
    By alrikvincent in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-12-2014, 08:55 AM
  4. Replies: 4
    Last Post: 08-11-2013, 12:58 AM
  5. Counting unique entries in a column, not excluding nulls
    By Lifeseeker in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-30-2013, 07:02 PM
  6. Replies: 0
    Last Post: 06-14-2012, 12:38 PM
  7. Counting unique column entries while also meeting other criteria
    By Mom2a* in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-04-2012, 05:21 AM

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