+ Reply to Thread
Results 1 to 5 of 5

Countifs with or - but not as sumproduct

  1. #1
    Registered User
    Join Date
    10-02-2014
    Location
    NY,NY
    MS-Off Ver
    MS Office 2010
    Posts
    13

    Countifs with or - but not as sumproduct

    ID City State Client Subscriber
    A NY NY Y Y

    I want to `count IDs` that have `Client=Y and Subscriber=Y and (City=NY or State=NY)`.
    Right now I am doing countifs(Client=Y and Subscriber=Y and City=NY and State=NY) + countifs(Client=Y and Subscriber=Y and City=NY and State<>NY) + countifs(Client=Y and Subscriber=Y and City<>NY and State=NY).

    What would be the most straight forward way to use `countifs()`, given that `or()` can't be used?
    Last edited by edost4; 10-10-2018 at 06:25 PM.

  2. #2
    Forum Contributor
    Join Date
    03-30-2016
    Location
    Gillette, WY
    MS-Off Ver
    Office 365
    Posts
    230

    Re: Countifs with or - but not as sumproduct

    Please post a sample sheet that represents your data and what you are trying to achieve. You can do this by: Go Advanced>Manage Attachments>Browse>Upload>Close Window>Post

    Thanks.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Countifs with or - but not as sumproduct

    Why would you have a problem using sumproduct?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: Countifs with or - but not as sumproduct

    You can shorten the formula using SUM and two arrays:

    =SUM(COUNTIFS(A:A,"Y",B:B,"Y",C:C,{"NY","<>NY","NY"},D:D,{"<>NY","NY","NY"}))

    which is the equivalent of adding the three counts you have now.
    Rory

  5. #5
    Registered User
    Join Date
    10-02-2014
    Location
    NY,NY
    MS-Off Ver
    MS Office 2010
    Posts
    13

    Re: Countifs with or - but not as sumproduct

    Thank you rorya this is exactly what I was looking for!

+ 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. Sumproduct vs countifs or Sumproduct + countifs
    By Xsample in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-01-2018, 02:16 PM
  2. Help with COUNTIFS and/or SUMPRODUCT
    By bayouwxman in forum Excel Formulas & Functions
    Replies: 27
    Last Post: 01-31-2018, 02:15 PM
  3. [SOLVED] Sumproduct to replace countifs as countifs don't work on external source reference
    By KrishnaSagar in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-02-2017, 02:33 AM
  4. [SOLVED] Sumproduct + countifs
    By toci in forum Excel Formulas & Functions
    Replies: 30
    Last Post: 03-27-2016, 04:09 PM
  5. [SOLVED] CountIfS and SUMPRODUCT need help
    By rschoenb in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-12-2014, 11:21 PM
  6. [SOLVED] Sumproduct/countifs
    By mahat in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-21-2014, 10:30 PM
  7. COUNTIFS and SUMPRODUCT help
    By Stacy1 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-19-2013, 02:35 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