Archive of Mr Excel Message Board


Back to Forms in Excel VBA archive index
Back to archive home

Countif? Multiple values

Posted by Paulo on October 15, 2001 1:40 AM
I know it must be simple, but I can't figure it out!
I want to do the following: count the total number of cells in A1:A20 that contain the values "r" or "p" or "n".

Many thanks.


Check out our Excel Resources

Re: Countif? Multiple values

Posted by Aladin Akyurek on October 15, 2001 2:35 AM
Try either

=COUNTIF(A1:A20,"r")+COUNTIF(A1:A20,"p")+COUNTIF(A1:A20,"n")

or

=SUMPRODUCT((A1:A20="r")+(A1:A20="p")+(A1:A20="n"))

Aladin

============


Thanks v. much (oh, so simple!) (NT)

Posted by Paulo on October 15, 2001 2:53 AM


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.