ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   count if (https://www.excelbanter.com/excel-discussion-misc-queries/18320-count-if.html)

Kevin

count if
 
=COUNTIF(B4:B17,"X")

this works great with X, but I would like to include L and V in this formula.
How would I do this???

Thanks



Dave Peterson

You could do the brute force version:
=COUNTIF(B4:B17,"X")+COUNTIF(B4:B17,"L")+COUNTIF(B 4:B17,"V")

or you could use something like:

=SUM(COUNTIF(B4:B17,{"X","L","V"}))
This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Kevin wrote:

=COUNTIF(B4:B17,"X")

this works great with X, but I would like to include L and V in this formula.
How would I do this???

Thanks


--

Dave Peterson

Alan Beban

Dave Peterson wrote:
You could do the brute force version:
=COUNTIF(B4:B17,"X")+COUNTIF(B4:B17,"L")+COUNTIF(B 4:B17,"V")

or you could use something like:

=SUM(COUNTIF(B4:B17,{"X","L","V"}))
This is an array formula.


I think it's not.

Alan Beban

Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Kevin wrote:

=COUNTIF(B4:B17,"X")

this works great with X, but I would like to include L and V in this formula.
How would I do this???

Thanks




Dave Peterson

I think you are correct!

Alan Beban wrote:

Dave Peterson wrote:

=SUM(COUNTIF(B4:B17,{"X","L","V"}))
This is an array formula.


I think it's not.

Alan Beban



All times are GMT +1. The time now is 01:21 PM.

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