+ Reply to Thread
Results 1 to 7 of 7

Using =COUNTIF to do a sequential count based on three matched columns.

  1. #1
    Forum Contributor
    Join Date
    06-25-2012
    Location
    U.K
    MS-Off Ver
    Excel 2016
    Posts
    101

    Using =COUNTIF to do a sequential count based on three matched columns.

    Hi all,

    I am having an issue with using a =COUNTIF() formula.

    I have a table with a number on columns and i am trying use one of the columns to keep a sequential count if three of the columns have matched data in them.

    It works OK as long as the third set of criteria is in the lower of the matched rows.

    To help explain i have included an example workbook.

    Here is the formula, =COUNTIFS($B$4:B4,B4,$C$4:C4,C4,$D$4:D4,"="&"D/T")
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Using =COUNTIF to do a sequential count based on three matched columns.

    you have fixed the d/t so it will match on any line, perhaps to avoid this
    =IF(D32="D/T",COUNTIFS($B$26:B32,B32,$C$26:C32,C32,$D$26:D32,"D/T"),0)

  3. #3
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Using =COUNTIF to do a sequential count based on three matched columns.

    The formula is returning the correct answer. The question is what are you seeking to count exactly? What is the answer you expect to see in E32, and why ?
    Maybe the formula needs to be adjusted accordingly..

  4. #4
    Forum Contributor
    Join Date
    06-25-2012
    Location
    U.K
    MS-Off Ver
    Excel 2016
    Posts
    101

    Re: Using =COUNTIF to do a sequential count based on three matched columns.

    Hi,

    If the first two sets of criteria are a match and the third set of criteria = D/T than keep a count. 1,2,3,4 and so on. As i mentioned, it works but only if D/T appears in the lowest of the matched rows. See sample workbook.

    i should also mention that the table will have new rows of data added to it.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Using =COUNTIF to do a sequential count based on three matched columns.

    ?? In e4, copied down:

    =IF(D4="D/T",COUNTIFS($B$4:B4,B4,$C$4:C4,C4,$D$4:D4,"D/T"),0)
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  6. #6
    Forum Contributor
    Join Date
    06-25-2012
    Location
    U.K
    MS-Off Ver
    Excel 2016
    Posts
    101

    Re: Using =COUNTIF to do a sequential count based on three matched columns.

    Thank you vary much.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Using =COUNTIF to do a sequential count based on three matched columns.

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

+ 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 Cells in Different Columns with Matched Criteria
    By bananacitizen in forum Excel General
    Replies: 8
    Last Post: 07-04-2018, 11:10 AM
  2. VBA Copy from sequential workbooks into a single workbook with sequential columns
    By YeknomDude in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-03-2017, 01:40 PM
  3. [SOLVED] Sequential count based on matching variable...
    By blak9 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-12-2016, 10:33 AM
  4. Add Multiple Columns Based on matched criteria
    By Moosey71889 in forum Excel General
    Replies: 1
    Last Post: 04-11-2015, 02:27 PM
  5. Replies: 5
    Last Post: 11-06-2014, 08:42 PM
  6. [SOLVED] copy sequential columns / paste to non-sequential columns
    By macrorookie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-09-2014, 04:59 PM
  7. [SOLVED] Summing columns based on matched values
    By Ace_XL in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-13-2013, 11:32 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