View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Counting a row based on criteria in 2 cols

Try this... works in any version of Excel.

=SUMPRODUCT(--(B1:B10<"Bear"),--(L1:L10="Goat"))

This version will only work in Excel 2007 or later.

=COUNTIFS(B1:B10,"<Bear",L1:L10,"Goat")

Better to use cells to hold the criteria.

A1 = Bear
A2 = Goat

=SUMPRODUCT(--(B1:B10<A1),--(L1:L10=A2))

=COUNTIFS(B1:B10,"<"&A1,L1:L10,A2)

--
Biff
Microsoft Excel MVP


"Big UT Fan" wrote in message
...
I need to count the cells in a worksheet where col B doesn't contain a
certain value and col L contains a different value. So...what I need to
do
is count the rows where col B doesn't contain "Bear" and col L contains
"Goat". Your help is appreciated.