+ Reply to Thread
Results 1 to 4 of 4

Count text column based on Two Grouping Columns

  1. #1
    Registered User
    Join Date
    02-13-2021
    Location
    Minnesota
    MS-Off Ver
    365
    Posts
    5

    Talking Count text column based on Two Grouping Columns

    Good morning

    I have three columns of data:

    Column A = ID#
    Column B = Week: Week1, Week2, Week3 . . . . up to Week30 for each ID #
    Column C = various codes: S, D, NS, A
    In Column D, I want to only count the A's for each week for each ID#

    A B C D
    ID# WEEK CODE A
    1 Week1 A 1
    1 Week1 D 1
    1 Week2 A 2
    1 Week2 A 2
    1 Week2 S 2
    2 Week1 A 2
    2 Week1 A 2
    2 Week2 A 3
    2 Week2 A 3
    2 Week2 D 3
    2 Week2 A 3

    I know I can use pivot tables, but this file will be used in a statistical package so I need to code the data a particular way.

    Thanks

    Marby

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 for Mac OSX, 365 for windows, Windows 10 Insider
    Posts
    6,548

    Re: Count text column based on Two Grouping Columns

    a spreadsheet as per the yellow banner, would have been good to see the setup
    try
    =IF(OR(A2="",B2=B1),"",COUNTIFS(A:A,A2,B:B,B2,C:C,"A"))
    and copy down

    OR if you need an entry for every row
    =IF(A2="","",COUNTIFS(A:A,A2,B:B,B2,C:C,"A"))
    Attached Files Attached Files
    Wayne

    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    02-13-2021
    Location
    Minnesota
    MS-Off Ver
    365
    Posts
    5

    Re: Count text column based on Two Grouping Columns

    That second formula worked beautifully. It was exactly what I needed.

    Thank you so much!

    Marby

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 for Mac OSX, 365 for windows, Windows 10 Insider
    Posts
    6,548

    Re: Count text column based on Two Grouping Columns

    you are welcome

+ 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. [SOLVED] Count all occurences of text in column D based on the text in column A
    By isthtmyname in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-28-2020, 05:00 AM
  2. Replies: 20
    Last Post: 08-24-2017, 02:40 AM
  3. Sum across columns based on column headers or count of columns
    By RandiLee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-08-2016, 09:59 AM
  4. [SOLVED] Grouping Data into one column from various columns based on a value
    By naga in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-24-2016, 03:00 AM
  5. [SOLVED] Trying to count text in column based on contents of another column
    By SACOOK33 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-16-2013, 08:54 AM
  6. Create a new column based on count of two other columns
    By ftcnt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-22-2012, 09:10 AM
  7. [SOLVED] SUMPRODUCT issue - need to count based on 3 text columns
    By ButtersEFC in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-17-2012, 09:02 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