count if question

  • Thread starter Thread starter DL
  • Start date Start date
D

DL

The Range(“B3:B13”) contains letters of the alphabet.

In cell B14, I need to check that two cells contain “l” (for late shift) and
two cells contain “e” (for early shift).
 
=COUNTIF("B3:B13", "e") will return the number of cells
that are exactly "e".
=COUNTIF("B3:B13", "e") ditoo for l's
=COUNTIF(B3:B13,"*e*") will return the number of cells
that contain an "e" anywhere (ie it will count "be" or "beep"
as one)
=COUNTIF(B3:B13,"*l*") ditto for l's

If you want just one cell to contain both counts you could
use something like:
=COUNTIF("B3:B13", "e") & ", " & COUNTIF("B3:B13", "l")
which would give "2, 3"
OR
=COUNTIF("B3:B13", "e") & " e's, " & COUNTIF("B3:B13", "l") & " l's"
which would give "2 e's, 3 l's"

Dan E
 
=COUNTIF(B3:B13,{"e","l"}) array entered into a two-column row, or
=COUNTIF(B3:B13,{"e";"l"}) array entered into a two-row column will
return the number of e's to the first cell, the number of l's to the second.

Alan Beban
 
Back
Top