+ Reply to Thread
Results 1 to 6 of 6

Can I use an OR function in a COUNTIFS formula?

  1. #1
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Boston, MA
    MS-Off Ver
    Office 2010
    Posts
    172

    Can I use an OR function in a COUNTIFS formula?

    I want to say =COUNTIFS($A:$A,OR("OCT","NOV","DEC")) but that doesn't seem to work.

    I also have the dates stored here so I could do something like greater than Oct 1 and less than Dec 31, if that helps

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Can I use an OR function in a COUNTIFS formula?

    One way...

    =SUM(COUNTIF($A:$A,{"OCT","NOV","DEC"}))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    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
    44,053

    Re: Can I use an OR function in a COUNTIFS formula?

    Maybe like this:

    =COUNTIFS(A:A,">=01/10/2014",A:A,"<=31/12/2014")
    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

  4. #4
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Can I use an OR function in a COUNTIFS formula?

    Alternative, assuming a Date value is in A


    Use Control + Shift + Enter to enter this Array Formula. I recomend replacing A:A with the actual range to speed up calculations.

    =SUM(--(MONTH(A:A)={10,11,12}))


    Advise you use something like this instead though, assuming 500 rows of data:

    =SUM(--(MONTH(A1:A500)={10,11,12}))
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  5. #5
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Can I use an OR function in a COUNTIFS formula?

    Quote Originally Posted by Speshul View Post
    =SUM(--(MONTH(A1:A500)={10,11,12}))
    By assuming.. data available only for one YEAR..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  6. #6
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Boston, MA
    MS-Off Ver
    Office 2010
    Posts
    172

    Re: Can I use an OR function in a COUNTIFS formula?

    Thank you Glenn Kennedy, that worked. Any idea why the quotes are necessary? That doesn't make sense to me since the dates are values in my spreadsheet.

    Speshul, does using defined ranges like that actually calculate quicker than using an entire column/row??? So many of my spreadsheets take FOREVER to calculate, this could be a lifesaver!

+ 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] Help with Countifs function
    By HDeuce in forum Excel General
    Replies: 3
    Last Post: 11-26-2014, 09:37 AM
  2. [SOLVED] Very long countifs formula - is there a better function?
    By k.m. in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 07-08-2013, 12:33 PM
  3. Replies: 3
    Last Post: 01-20-2012, 01:20 PM
  4. Replies: 0
    Last Post: 12-16-2011, 09:01 AM
  5. CountIFS using an OR function
    By Maudise in forum Excel General
    Replies: 6
    Last Post: 08-09-2010, 10:47 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