+ Reply to Thread
Results 1 to 6 of 6

CountIfs returning 0

  1. #1
    Registered User
    Join Date
    02-10-2014
    Location
    Somewhere
    MS-Off Ver
    Excel 2010
    Posts
    39

    CountIfs returning 0

    All,

    I'm trying to count the number of Mondays in each month of the year as sometimes it is 4 and sometimes it is 5.

    In row 1, I have listed the dates for all 52 Mondays in the year.

    In Row 3, I have listed the dates for the first day of every month in the year.

    Then, I have tried to use the following formula to count the Mondays in each month: =COUNTIFS($B$1:$BA$1,">=b3",$B$1:$BA$1,"<c3")

    However, it returns 0.

    Does anyone know of a better way to quickly identify the number of Mondays in each month or why my formula is failing?

    Please see the attached file for my problem.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: CountIfs returning 0

    Your formula needs to be like this:

    =COUNTIFS($B$1:$BA$1,">="&b3,$B$1:$BA$1,"<"&c3)

    as you had it, you were trying to compare the literal strings B3 and C3 to those dates, rather than the cell contents.

    Hope this helps.

    Pete

  3. #3
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: CountIfs returning 0

    =COUNTIFS($B$1:$BA$1,">=b3",$B$1:$BA$1,"<c3")

    Try changing the parts in RED to:
    ">="&B3
    "<"&C3

    - Moo

  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: CountIfs returning 0

    Pete beat me to it...

    Was trying to reply on my phone... Takes a bit longer.

    - Moo

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: CountIfs returning 0

    You will also need to put 01/01/2016 in N3 if you want to copy the formula across to column M.

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    02-10-2014
    Location
    Somewhere
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: CountIfs returning 0

    You guys are awesome, worked like a charm.

    Thanks.

+ 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. countifs returning value error
    By ammartino44 in forum Excel General
    Replies: 2
    Last Post: 10-03-2014, 06:22 PM
  2. COUNTIFs formula returning a #VALUE!
    By GanbareGoemon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-27-2014, 10:46 AM
  3. [SOLVED] COUNTIFS returning #VALUE!
    By photoryan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-18-2013, 01:07 AM
  4. SUMPRODUCT and COUNTIFS formula that is returning #DIV/0!
    By caseyjones05 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-19-2013, 03:37 PM
  5. [SOLVED] COUNTIFS Fuction returning wrong data
    By christopherw34 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2012, 12:31 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