Count cells that are text and contain either x or y

You can display the number of cells that contain either value X or value Y using the COUNTIFS function.


Example

=COUNTIFS(B1:C5,"mon") + COUNTIFS(B1:C5,"tue")



Alternative Formula - SUM, COUNTIF

This uses an array of possible values
=SUM(COUNTIF(B1:C5. {"mon", "tue}))


Alternative Formula - SUM, IF

You could combine the SUM function and the IF function
=SUM(IF((B1:C5="mon") + (B1:C5="tue"), 1, 0))


Alternative Formula - SUMPRODUCT

This formula is quite slow for large data
=SUMPRODUCT((B1:C5="mon") + (B1:C5="tue))


Related Formula

Count cells that are numbers either x or y
Count cells that are dates either x or y


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top