Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default COUNTIF

=SUMPRODUCT(--(D4:D145="M"),--(E4:E145=#))
and for the ladies
=SUMPRODUCT(--(D4:D145="W"),--(E4:E145=#))

That should help some. To explain, the tests of D4:D145 work row by row and
each one is evaluated either true (1) or false(0). The results for that row
are multiplied by one another and that result is kept in a running total.
For any given row you have possible results:
0 * 1 = 0
1 * 0 = 0
0 * 0 = 0
1 * 1 = 1
so only when both conditions are met do you get a non-zero value to keep a
running total of.

Try it, you'll like it.
"mpajenn" wrote:

In one column I have "M" or "W" and in the next column I have # representing
shoe sizes. To get a shoe count I put in the formula
=countif(d4:d145,m)+countif(e4:e145,#), (the # sign represents the shoe size
I am trying to count). The formula works good except if a shoe size falls
into both the m and w category it shows up in both counts instead of just the
one. I have tried putting "" marks around the M or W but it does not help.
Anyone have any ideas?

Jenn

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
COUNTIF Will Excel Worksheet Functions 0 March 28th 07 02:00 AM
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") sctroy Excel Discussion (Misc queries) 2 September 25th 05 04:13 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM


All times are GMT +1. The time now is 05:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"