+ Reply to Thread
Results 1 to 7 of 7

countifs question

  1. #1
    Registered User
    Join Date
    12-10-2013
    Location
    dallas, tx
    MS-Off Ver
    Excel 2007
    Posts
    36

    countifs question

    Column A Column B
    2012 20
    2012 30
    2013 50
    2013 30
    2013 50
    2014 10

    I've got two columns like this. I need to see if a countifs() would handle it for me, or if there's another formula to use.

    I need to get a count of all fields in column B that are unique and are 2013 in Column A. In this case the answer would be 2 (in 2013 there was a 30 and a 50, duplicates are skipped)
    Last edited by Scalpel4; 12-17-2013 at 06:43 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: countifs question

    try
    =SUMPRODUCT((A1:A10=2013)/COUNTIFS(A1:A10,A1:A10&"",B1:B10,B1:B10&""))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: countifs question

    Another with CSE..

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  4. #4
    Registered User
    Join Date
    12-10-2013
    Location
    dallas, tx
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: countifs question

    The sumproduct is taking forever to calculate, I'll try the sum.

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

    Re: countifs question

    If the data to be counted really is numbers, try this...


    Data Range
    A
    B
    C
    D
    E
    1
    Year
    Value
    -----
    Year
    Count
    2
    2012
    20
    2013
    2
    3
    2012
    30
    4
    2013
    50
    5
    2013
    30
    6
    2013
    50
    7
    2014
    10


    This array formula** entered in E2:

    =SUM(IF(FREQUENCY(IF(A2:A7=D2,B2:B7),B2:B7),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.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    12-10-2013
    Location
    dallas, tx
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: countifs question

    Debraj and Tony, both work well, thanks! I completely forgot about arrays. I'll be using Tony's because its shorter and I'm adding in some logical statements, fortunately I remember those operators required for arrays.

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

    Re: countifs question

    You're welcome. We appreciate the feedback!

+ 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. COUNTIFS Question
    By rdp33 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-28-2013, 07:27 PM
  2. [SOLVED] CountIFs question
    By Ryuujin in forum Excel General
    Replies: 4
    Last Post: 06-12-2012, 07:33 AM
  3. Replies: 0
    Last Post: 12-16-2011, 09:01 AM
  4. Question on max, countifs
    By poolcue in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-09-2011, 04:54 AM
  5. countifs question
    By jfarino in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-02-2007, 07:21 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