Home > OS >  Is there a way to add an "else" statement to COUNTIFS function in Excel?
Is there a way to add an "else" statement to COUNTIFS function in Excel?

Time:07-07

I have a excel formula with COUNTIFS to count the number of values with certain conditions, but if there is nothing to count or if the total number of values is 0, it just shows up as blank. I was wondering how to add an else statement so that if there are no values or 0 values it would display 0 instead of just blank

=COUNTIFS(Table22[Report Deadline],"<=" & TODAY() 7,Table22[Report Deadline],">=" & TODAY())

CodePudding user response:

If you have Excel 365 you can use this formula:

=COUNT(FILTER(Table22[Report Deadline],(Table22[Report Deadline]>=TODAY())*(Table22[Report Deadline]<=TODAY() 7),""))

It first filters and then counts the relevant dates.

  • Related