Attempting to count cells in Excel using multiple criteria

前端 未结 2 1444
醉梦人生
醉梦人生 2021-01-26 15:51

As the title states, I am trying to count across cell ranges on a separate sheet but cant seem to get it to work. Any help would be greatly appreciated.

=COUNTIF         


        
2条回答
  •  星月不相逢
    2021-01-26 16:04

    You cannot use the MONTH function as a form of sub-function in a COUNTIFS function. You need to add an extra level of calculation with something like a SUMPRODUCT function.

    =SUMPRODUCT((MONTH(original!A2:A58)=1)*(original!D2:D58="East"))
    

    That should count the instances where the month of the date in the Original worksheet's column A is January and the corresponding row's column D is East.

    If you prefer to stay with a COUNTIFS and can keep the dates to a single year, you can provide a start date and end date which will bracket the month of January for a particular year.

    =COUNTIFS(Original!A2:A58,">="&DATE(2015,1,1),Original!A2:A58,"<"&DATE(2015,2,1),Original!D2:D58,"East")
    

    The default comparison operator for COUNTIFS is equals. There is no need to type it in.

提交回复
热议问题