+ Reply to Thread
Results 1 to 5 of 5

If and CountIF combo?

  1. #1
    Registered User
    Join Date
    05-20-2014
    Posts
    7

    If and CountIF combo?

    Col1 Col2
    1____a
    1____a
    1____b
    2____c
    3____d
    3____d

    I need a formula in column 3 that can count how many different letters there are in column 2 based for each value in column 1

    So in this instance since the "1" in col1 has both an a and a b associated with it, i need it to give me a count of 2. (In the case of 3, it only is associated with d, so a count of 1 is appropriate)

    Col1 Col2 Col3
    1____a___2
    1____a___2
    1____b___2
    2____c___1
    3____d___1
    3____d___1

    Please let me know if this is not clear
    Last edited by mcarp; 06-09-2014 at 01:26 PM.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,695

    Re: If and CountIF combo?

    there are quite a few ways to do it. One would be to use a concatenate. so if the columns are as you note, you could do this in col3 =(A1&B1) then in col4 =COUNTIF(C:C,A1&B1)

    EDIT: of course best then would be to create a distinct table (w/o duplicates) elsewhere then base the count on that. Then you get a distinct count based on specific single instances.
    Last edited by Sam Capricci; 06-09-2014 at 12:29 PM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: If and CountIF combo?

    Try this Array Formula. Since this is an array formula so you need to confirm it with Ctrl+Shift+Enter instead of just Enter.

    Please Login or Register  to view this content.
    and copy down.

    Is this what you are trying to achieve?
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Registered User
    Join Date
    05-20-2014
    Posts
    7

    Re: If and CountIF combo?

    Yes that was exactly what I was looking for sktneer! thanks!

  5. #5
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: If and CountIF combo?

    You're welcome. Thanks for 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. VBA Countif to fill textbox based on two combo boxes
    By SamuelJackson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2014, 10:14 AM
  2. Replies: 8
    Last Post: 12-26-2013, 02:23 PM
  3. [SOLVED] Excel 2010 VBA – Combo Box Options– Clear cell/box in 2nd Combo when 1st Combo selected
    By theshybutterfly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2013, 07:25 PM
  4. IF and COUNTIF Combo
    By CollieGarv in forum Excel General
    Replies: 2
    Last Post: 02-21-2011, 04:29 PM
  5. Filtered list for Combo Box ListFillRange - Nested Combo Boxes
    By DoctorG in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2006, 08:20 AM

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