Software >> Applications >> Microsoft Office >> Excel >>  What is the formula to count the number of Sundays in a month

Assumes the date for the current month is in Cell C5, otherwise substitute accordingly for the correct Year and Month. =IF(AND(DAY(DATE(Year(C5),Month(C5) 1,1)-1)>28,WEEKDAY(DATE(Year(C5),Month(C5),1),2) >35-DAY(DATE(Year(C5),Month(C5) 1,1)-1)),5,4)