+ Reply to Thread
Results 1 to 3 of 3

Count cells which match a single criterion across an array of cells

  1. #1
    Registered User
    Join Date
    11-29-2016
    Location
    Kintore, Scotland
    MS-Off Ver
    Office 2016
    Posts
    9

    Count cells which match a single criterion across an array of cells

    Hi folks,

    Would really appreciate some help - been scratching my head with this all night...

    I'm trying to count the number of cells which match a single criteria, across an array of cells. Please see attached sample dataset.

    In cell B2, I need a formula to count all weekend cells (e.g. F2:G2,M2:N2,T2:U2,AA2:AB2) which contain the text string "OD". For B2, the formula should return 7. For B3, the formula should return 4 (F3:G3,M3:N3,T3:U3,AA3:AB3. For B4, the formula should return 5 (F4:G4,M4:N4,T4:U4,AA4:AB4).

    My dataset is much larger than the example I've uploaded, and I successfully managed to get "COUNTIF" working, but unfortunately my formula ended up having too many arguements. I think HSTACK might be the way to go, but I can't figure out how to get this working properly.

    Any help greatly appreciated...!!

    Weekend Counting.xlsx

  2. #2
    Forum Contributor
    Join Date
    11-20-2007
    Location
    Felixstowe, England
    MS-Off Ver
    Excel 2013, 2019
    Posts
    217

    Re: Count cells which match a single criterion across an array of cells

    In B2 put this formula:
    =SUMPRODUCT(--(WEEKDAY($C$1:$AC$1,2)>=6)*--(C2:AC2="OD"))
    ... and copy down.

  3. #3
    Registered User
    Join Date
    11-29-2016
    Location
    Kintore, Scotland
    MS-Off Ver
    Office 2016
    Posts
    9

    Re: Count cells which match a single criterion across an array of cells

    Thanks GlennUK - worked a charm 👍

+ 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. Count distinct from multiple columns using a single criterion
    By leefletcher in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-15-2020, 12:50 PM
  2. Count blank cells in a range and contiguous blank cells also as single cells! Tricky One!
    By SebastianColombia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-31-2015, 02:32 PM
  3. Replies: 9
    Last Post: 06-25-2013, 09:00 AM
  4. [SOLVED] Row count using more than a single criterion?
    By TBrun in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-22-2013, 09:08 AM
  5. Adding numbers from cells that match a criterion from COUNTIF ?
    By annekrijn in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-20-2013, 11:25 AM
  6. Can I make all cells in a column that match a certain criterion change colour?
    By torontoem4o in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-11-2012, 12:53 AM
  7. Replies: 6
    Last Post: 10-17-2012, 07:32 PM

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