+ Reply to Thread
Results 1 to 7 of 7

Count Number of occurences Across Columns based on Similar Column Headers

  1. #1
    Forum Contributor
    Join Date
    02-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    102

    Count Number of occurences Across Columns based on Similar Column Headers

    Hello,

    i have given the scenario and expected result from a formula. Can someone let me know if it is feasible and if so how can it be accomplished

    Example:

    A B C D E F G
    Name Cat1 Cat2 Cat2 Cat1 Cat2 Cat1

    1 Name1 Y Y N N Y Y

    2 Name2 N N Y N Y y

    3 Name1 Y Y N Y N Y

    Expected Result

    G4 = Name1 ( Input value)
    G5 = Cat1 ( Input value)
    G6 = Formula should help to : Count of Number of Y across ALL columns for Given value in G4 & G5 ( it should count all the Ys appearing in all Columns between B:G but it should count only if the Column Header = Value in G5 (Cat1 in this example) and Name=value in G4 ( Name1 in this example)
    Thanks.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Count Number of occurences Across Columns based on Similar Column Headers

    If I understand you correctly, take a look at using the countifS() function
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    02-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: Count Number of occurences Across Columns based on Similar Column Headers

    Thanks for your response, but iam aware of countifs function but unsure if it can help in this scenerio. Countifs can take criteria range ( which can be only one colum, i guess) and a criteria but here i need to Count Number of Y's appearing on ALL Columns between B:G but the header ( row1) =cat1 and name(Column A)=Name1

    Hope i am able to explain. Thanks.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Count Number of occurences Across Columns based on Similar Column Headers

    Note, I suggested countifS(), not countif() CountifS() allows for multiple criteria to base the count on...

    =countifS(criteria_range1,criteria1,criteria_range2,criteria2,criteria_range3,criteria3.........................)

    It can also be used with a range across multiple columns

    If you upload a sample workbook, I will see what we can put together

  5. #5
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Count Number of occurences Across Columns based on Similar Column Headers

    is this what you meant?
    Attached Files Attached Files
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  6. #6
    Forum Contributor
    Join Date
    02-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: Count Number of occurences Across Columns based on Similar Column Headers

    Thanks. Sample Worksheet attached.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    02-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: Count Number of occurences Across Columns based on Similar Column Headers

    Thanks Icesta. Most perfect. It is resolved and thanks FDibbins too for helping.

+ 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