+ Reply to Thread
Results 1 to 4 of 4

Combining IF and COUNTIF functions

  1. #1
    Registered User
    Join Date
    02-26-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2003
    Posts
    8

    Combining IF and COUNTIF functions

    Hello,

    I'm hoping that someone can help me figure this out.

    I would like to create a formula that would allow me to count the number of entries in a column that meet the criteria set forth in a previous column.

    Column A - contains Y or N
    Column B - contains Y or N

    I want to count the number of entries in Column B that = Y only if Column A = Y

    Or...if column A = Y, how many in column B = Y

    Any assistance is appreciated

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Combining IF and COUNTIF functions

    Hi,

    This should work for you

    =SUMPRODUCT((A1:A100="Y")*(B1:B100="Y"))

    Adjust ranges as required.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    02-16-2010
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Combining IF and COUNTIF functions

    Not exactly sure what you want here but assuming you have only one entry in column A then;

    =IF(ColumnACellWithData="Y", COUNTIF(B:B,"Y"), IF(ColumnACellWithData="N", COUNTIF(B:B,"N"),"Column A entry Invalid"))

  4. #4
    Registered User
    Join Date
    02-26-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Combining IF and COUNTIF functions

    Quote Originally Posted by sweep View Post
    Hi,

    This should work for you

    =SUMPRODUCT((A1:A100="Y")*(B1:B100="Y"))

    Adjust ranges as required.
    Sweep,
    This worked perfectly - thank you!

+ 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