SOLVED

COUNTIFS

Copper Contributor

=COUNTIFS(E2:E49,"=President",E2:E49,"=Secretary") returns 0 but works individually I can't find the error

 

E2:E49 contain a list of Offices including the above exact spelling the individual countifs works and gives the correct result?

 

Any help appreciated

Thank you

2 Replies

@Pansophy 

COUNTIFS returns the number of cells that satisfy ALL conditions at the same time.

A cell cannot be equal to President and to Secretary at the same time, so the result is 0.

If you want to count the number of cells that are either President or Secretary, use

 

=SUM(COUNTIF(E2:E49,{"President","Secretary"}))
best response confirmed by Pansophy (Copper Contributor)
Solution

@Hans Vogelaar Thank you so simple and obvious, thank you for taking the time to solve my problem.

 

 

1 best response

Accepted Solutions
best response confirmed by Pansophy (Copper Contributor)
Solution

@Hans Vogelaar Thank you so simple and obvious, thank you for taking the time to solve my problem.

 

 

View solution in original post