ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   count if question (https://www.excelbanter.com/excel-programming/276910-count-if-question.html)

DL[_3_]

count if question
 
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).





Dan E[_2_]

count if question
 
=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

"DL" wrote in message
...
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).







DL[_3_]

count if question
 
Thanks!!




Alan Beban[_3_]

count if question
 
=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

DL wrote:
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).







All times are GMT +1. The time now is 11:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com