PC Review


Reply
Thread Tools Rate Thread

Counting values in a range

 
 
Khalil Handal
Guest
Posts: n/a
 
      6th Nov 2006
Hi to all,

Range C5:C32 contains letters either "C" or "M"

Range D532 contains letters either "M" or "F"



I want to count the number of combinations of the letters which are as
follows:

CM

CF

MM

MF

Starting cell D35 growing down to cell D38

I tried to write an array formula but always having an error.



Thanks in Advance



Khalil Handal


 
Reply With Quote
 
 
 
 
jeff.t@virgin.net
Guest
Posts: n/a
 
      7th Nov 2006
Hi

I'd simply use columns E, F, G, & H (which can be hidden if wanted) and
insert the following in each:-

E =IF(AND(C5="C",D5="M"),1,0)

F =IF(AND(C5="C",D5="F"),1,0)

G =IF(AND(C5="M",D5="M"),1,0)

H =IF(AND(C5="M",D5="F"),1,0)

Then sum each of these columns in row 33 and use in cell D35 " =E33",
D36 " =F33" etc

It's not elegant but simple and it works

Jeff


Khalil Handal wrote:
> Hi to all,
>
> Range C5:C32 contains letters either "C" or "M"
>
> Range D532 contains letters either "M" or "F"
>
>
>
> I want to count the number of combinations of the letters which are as
> follows:
>
> CM
>
> CF
>
> MM
>
> MF
>
> Starting cell D35 growing down to cell D38
>
> I tried to write an array formula but always having an error.
>
>
>
> Thanks in Advance
>
>
>
> Khalil Handal


 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      8th Nov 2006
To count CM's:

=sumproduct(--(c5:c32="C"),--(d5:d32="M"))

Adjust the ranges to match--but you can't use whole columns.

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail here:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html



Khalil Handal wrote:
>
> Hi to all,
>
> Range C5:C32 contains letters either "C" or "M"
>
> Range D532 contains letters either "M" or "F"
>
> I want to count the number of combinations of the letters which are as
> follows:
>
> CM
>
> CF
>
> MM
>
> MF
>
> Starting cell D35 growing down to cell D38
>
> I tried to write an array formula but always having an error.
>
> Thanks in Advance
>
> Khalil Handal


--

Dave Peterson
 
Reply With Quote
 
Adel Handal
Guest
Posts: n/a
 
      8th Nov 2006
Hi,
thanks a lot!

Khalil

"Dave Peterson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> To count CM's:
>
> =sumproduct(--(c5:c32="C"),--(d5:d32="M"))
>
> Adjust the ranges to match--but you can't use whole columns.
>
> =sumproduct() likes to work with numbers. The -- stuff changes trues and
> falses
> to 1's and 0's.
>
> Bob Phillips explains =sumproduct() in much more detail here:
> http://www.xldynamic.com/source/xld.SUMPRODUCT.html
>
> And J.E. McGimpsey has some notes at:
> http://mcgimpsey.com/excel/formulae/doubleneg.html
>
>
>
> Khalil Handal wrote:
>>
>> Hi to all,
>>
>> Range C5:C32 contains letters either "C" or "M"
>>
>> Range D532 contains letters either "M" or "F"
>>
>> I want to count the number of combinations of the letters which are as
>> follows:
>>
>> CM
>>
>> CF
>>
>> MM
>>
>> MF
>>
>> Starting cell D35 growing down to cell D38
>>
>> I tried to write an array formula but always having an error.
>>
>> Thanks in Advance
>>
>> Khalil Handal

>
> --
>
> Dave Peterson



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting the # of values in a range ??? GoBucks Microsoft Excel Worksheet Functions 8 9th Apr 2009 09:34 PM
Counting Values in a Range Giraffe3289 Microsoft Excel Programming 0 6th Feb 2009 07:48 PM
Counting Values in a Range of Columns =?Utf-8?B?RGlhbmVT?= Microsoft Access Getting Started 7 9th Apr 2006 04:04 AM
Counting by a Range of Values? Ender Microsoft Excel Worksheet Functions 7 7th Apr 2006 11:06 PM
Counting a Range of Values slyverson Microsoft Excel Misc 0 1st Sep 2005 10:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:18 PM.