+ Reply to Thread
Results 1 to 3 of 3

Two COUNTIF formula in one cell

  1. #1
    Registered User
    Join Date
    09-16-2010
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Two COUNTIF formula in one cell

    I have a table that counts the number of "Y" that i add to cells =COUNTIF(H2:O2,"Y")

    Conditional formatting then turns the cell fill to green.

    Is it possible to add another COUNTIF in the same cell if I put a "B" instead of a "Y"?

    I need the total number on Column O to read the same whether it is counting "B" or "Y"

    As you can see in the attached image, the count is only good for "Y".

    COUNTIF.JPG

    Many thanks

    Rob

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,265

    Re: Two COUNTIF formula in one cell

    This ???

    =COUNTIF(H2:O2,"Y")+COUNTIF(H2:O2,"B")

    or

    =SUM(COUNTIF(H2:O2,{"Y","B"}))
    Last edited by JohnTopley; 09-03-2021 at 10:13 AM.

  3. #3
    Registered User
    Join Date
    09-16-2010
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Two COUNTIF formula in one cell

    Many thanks for your swift reply John


    Both actually worked and produced the result I want.

    I tried a few attempts myself but couldn't get it right!

    Thanks again, much appreciated.

    Rob

+ 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] Posting countif formula to cell using VBA
    By Neuk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-07-2018, 02:21 PM
  2. [SOLVED] Countif formula shows value according to cell
    By andy_tap in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 09-01-2016, 11:32 AM
  3. [SOLVED] Formula Help, Countif (every other cell, X as 1)
    By EBFH in forum Excel General
    Replies: 7
    Last Post: 07-26-2016, 04:17 PM
  4. [SOLVED] Enter formula result from one cell into a COUNTIF formula in another cell. Help please!
    By gregrach in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-10-2014, 11:23 AM
  5. [SOLVED] countif formula changes cell values and cell reference is unchanged
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-24-2014, 11:37 AM
  6. [SOLVED] Countif formula in one cell
    By sandiptemkar in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-28-2013, 11:38 AM
  7. COUNTIF formula with reference to cell above
    By pri31 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-02-2013, 08:07 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