[mso] Re: Count Non-Blank Cells in Excel 2002

  • From: "David Smart" <smartware@xxxxxxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Mon, 9 Jul 2007 21:18:07 +1000

FIND("abc",A1:A9)

This is the Find function, but with a range of cells so that it can be used 
with SumProduct.  It will return >0 for each cell if "abc" is found or 
#value if not found.

ISERROR(FIND("abc",A1:A9))

True if not found, false if found.

NOT(ISERROR(FIND("abc",A1:A9)))

True if found, false if not found.

(NOT(ISERROR(FIND("abc",A1:A9))))

The extra pair of parentheses required by SumProduct.

*1

A multiplication operation (multiply by 1).  When multiplied by True gives 
1; when multiplied by False gives 0.

And then SumProduct adds them up.

You can't use the FIND("abc",A1:A9) separately - it needs to be inside the 
SumProduct because of the range in the second parameter.  However, you could 
use FIND("abc",A1) to check for "abc" in A1.

HTH

Regards, Dave S

BTW don't think that I just typed this in in one go.  I built it up from the 
inside out until I had

=NOT(ISERROR(FIND("abc",A1)))

working properly.  Then I put it into the SumProduct and extended the A1 to 
the full range.

----- Original Message ----- 
From: "Vergel Villacorta" <atrocallivlegrev@xxxxxxxxx>
To: <mso@xxxxxxxxxxxxx>
Sent: Monday, July 09, 2007 4:32 PM
Subject: [mso] Re: Count Non-Blank Cells in Excel 2002


> Dave,
>
>  can you discuss how the formula works. i tried using the functions 
> separately but it didnt work.
>  thanks.
>
>  vergel
> Ray Shapp <ras45@xxxxxxxxxxxxx> wrote:
>  Wow, Dave!
>
> I never would have looked at the SUMPRODUCT function as a possible 
> solution to
> my problem. Needless to say, your solution works perfectly. Many thanks.
>
> Ray Shapp
>
>
> ----- Original Message ----- 
> From: "David Smart"
> To:
> Sent: Saturday, July 07, 2007 2:34 PM
> Subject: [mso] Re: Count Non-Blank Cells in Excel 2002
>
>
>> =SUMPRODUCT((NOT(ISERROR(FIND("abc",A1:A9))))*1)
>>
>> Regards, Dave S
>>
>> ----- Original Message ----- 
>> From: "Ray Shapp"
>> To:
>> Sent: Sunday, July 08, 2007 2:48 AM
>> Subject: [mso] Count Non-Blank Cells in Excel 2002
>>
>>
>>> Hi All,
>>>
>>> In Excel 2002, I want to count the number of cells in a column that are
>>> non-blank AND contain a particular literal string among the characters 
>>> in
>>> the
>>> cell. As an example, I want to count all non-blank cells that contain
>>> "abc" in
>>> their contents. In the sample column below, the value I seek would be 2:
>>>
>>> A1 "bca"
>>> A2 "cats are gray"
>>> A3 "dogs are brown"
>>> A4
>>> A5 "bats fly"
>>> A6 "this is as simple as abc"
>>> A7 "a bc"
>>> A8 "zebras"
>>> A9 "12 45 abc 67"
>>>
>>> Only cells A6 and A9 meet the criterion.
>>>
>>> I tried =COUNTIF(A1:A9, "abc") but that returned zero because no cell
>>> contains just "abc".
>>>
>>> Is there a way to substitute a string function in place of the literal,
>>> "abc"?
>>>
>>> Thanks for the help.
>>>
>>> Ray Shapp
>>>
>>>
>>> *************************************************************
>>> You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx 
>>> or
>>> MicrosoftOffice@xxxxxxxxxxxxxxxx
>>>
>>> To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
>>>
>>> To Unsubscribe from this group, visit the group's homepage and use the
>>> dropdown menu at the top. This will allow you to unsubscribe your email
>>> address or change your email settings to digest or vacation (no mail).
>>> //www.freelists.org/webpage/mso
>>>
>>> To be able to share files with the group, you must join our Yahoo sister
>>> group. This group will not allow for posting of emails, but will allow
>>> you to join and share problem files, templates, etc.:
>>> http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for
>>> FILE SHARING ONLY.
>>>
>>> If you are using Outlook and you see a lot of unnecessary code in your
>>> email messages, read these instructions that explain why and how to fix
>>> it:
>>> http://personal-computer-tutor.com/abc3/v28/greg28.htm
>>> *************************************************************
>>
>> *************************************************************
>> You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx 
>> or
>> MicrosoftOffice@xxxxxxxxxxxxxxxx
>>
>> To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
>>
>> To Unsubscribe from this group, visit the group's homepage and use the
>> dropdown menu at the top. This will allow you to unsubscribe your email
>> address or change your email settings to digest or vacation (no mail).
>> //www.freelists.org/webpage/mso
>>
>> To be able to share files with the group, you must join our Yahoo sister
>> group. This group will not allow for posting of emails, but will allow 
>> you
>> to join and share problem files, templates, etc.:
>> http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for 
>> FILE
>> SHARING ONLY.
>>
>> If you are using Outlook and you see a lot of unnecessary code in your 
>> email
>> messages, read these instructions that explain why and how to fix it:
>> http://personal-computer-tutor.com/abc3/v28/greg28.htm
>> *************************************************************
>
> *************************************************************
> You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
> MicrosoftOffice@xxxxxxxxxxxxxxxx
>
> To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
>
> To Unsubscribe from this group, visit the group's homepage and use the 
> dropdown menu at the top. This will allow you to unsubscribe your email 
> address or change your email settings to digest or vacation (no mail).
> //www.freelists.org/webpage/mso
>
> To be able to share files with the group, you must join our Yahoo sister 
> group. This group will not allow for posting of emails, but will allow you 
> to join and share problem files, templates, etc.: 
> http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for 
> FILE SHARING ONLY.
>
> If you are using Outlook and you see a lot of unnecessary code in your 
> email messages, read these instructions that explain why and how to fix 
> it:
> http://personal-computer-tutor.com/abc3/v28/greg28.htm
> *************************************************************
>
>
>
> ---------------------------------
> Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's 
> on, when.
>
> *************************************************************
> You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
> MicrosoftOffice@xxxxxxxxxxxxxxxx
>
> To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
>
> To Unsubscribe from this group, visit the group's homepage and use the 
> dropdown menu at the top.  This will allow you to unsubscribe your email 
> address or change your email settings to digest or vacation (no mail).
> //www.freelists.org/webpage/mso
>
> To be able to share files with the group, you must join our Yahoo sister 
> group.  This group will not allow for posting of emails, but will allow 
> you to join and share problem files, templates, etc.: 
> http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for 
> FILE SHARING ONLY.
>
> If you are using Outlook and you see a lot of unnecessary code in your 
> email messages, read these instructions that explain why and how to fix 
> it:
> http://personal-computer-tutor.com/abc3/v28/greg28.htm
> *************************************************************
> 

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, visit the group's homepage and use the dropdown 
menu at the top.  This will allow you to unsubscribe your email address or 
change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to share files with the group, you must join our Yahoo sister group. 
 This group will not allow for posting of emails, but will allow you to join 
and share problem files, templates, etc.:  
http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for FILE 
SHARING ONLY.

If you are using Outlook and you see a lot of unnecessary code in your email 
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************

Other related posts: