Search code examples
excelcountifsumifs

SUMIF SUM IF Formula not calculating correct - counting blank cells


I Have a sheet ive been working on that has proven to work well other than one cell. The cell is to count all the cells that contain a date within the month of JANUARY. The current Range is B2:B30, it gives me the number 29 even though the cells are blank. I have the same formula just up by a month for the entire year without issue. I would love help on this!

FORMULA =SUM(IF(MONTH(B2:B30)=1,1))

When I put in dates anywhere in that range it does bring the count down below 29 as if its counting blank cells. I have it on an identical sheet just with a different year and no issues!

29 count even though they're blank


Solution

  • You should just need to check for blanks - a "zero" date is indeed in January (Jan 1900 specifically).

    =SUM(IF(MONTH(B2:B30)=1,IF(B2:B30>0,1,0),0))