Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Counting using OR?

I have 2 columns and want to get the count of each row where either
one of columns in that row is = "Y" and if both are = "Y", it still
only counts as one "Y". So, with the following (Row #s included at
left to avoid confusion)

Row Column A Column B
1 Y Y
2 Y
3 Y
4
5
6 Y
7 Y
8 Y

We should count 6 (rows 1, 2, 3, 6, 7, and 8 contain a "Y" in either
Column A or B)

NOTE: Rows with two "Y"s should only count once which is where I'm
having trouble using CountA

I'm really trying to avoid using any Macros or code other than built-
in functions if possible as some users will not have these activated
for security reasons.

Thanks!

-Aaron

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 92
Default Counting using OR?

Hi Aaron,

A general approach to apply OR criteria in sumproducts is IMHO
=SUMPRODUCT(SIGN((A1:A8="Y")+(B1:B8="Y")))

Regards,
Bernd

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Counting using OR?

Both of these examples work and are exactly what I'm looking for, so
thanks!!!!

Could you please elaborate on which would be better and why and
perhaps break it down for a newbie to these functions?

Thanks again!!!

-Aaron

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Counting using OR?

Ooops...I lied...this one does NOT work when there is nothing in
Column A but there is in Column B such as in Row 3 below. The other
one posted with the sign function DOES work in this case so I'll use
that. Again, I'd still like an explanation of how specifically that
works so that I can apply it to future functions please. Thanks!

-Aaron


On Feb 20, 12:10 am, JE McGimpsey wrote:
One way:

=SUMPRODUCT(--ISNUMBER(FIND("Y",A1:A8&B1:B8)))

In article .com,

wrote:
I have 2 columns and want to get the count of each row where either
one of columns in that row is = "Y" and if both are = "Y", it still
only counts as one "Y". So, with the following (Row #s included at
left to avoid confusion)


Row Column A Column B
1 Y Y
2 Y
3 Y
4
5
6 Y
7 Y
8 Y


We should count 6 (rows 1, 2, 3, 6, 7, and 8 contain a "Y" in either
Column A or B)


NOTE: Rows with two "Y"s should only count once which is where I'm
having trouble using CountA


I'm really trying to avoid using any Macros or code other than built-
in functions if possible as some users will not have these activated
for security reasons.


Thanks!


-Aaron





  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 92
Default Counting using OR?

Hello,

Hmm, both versions should work quite fine.

Actually, JE's version even differentiates between upper case Y and
lower case y (which are NOT counted).

Explanations you can find here, for example:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

Regards,
Bernd

Reply
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
Counting Jason30 Excel Discussion (Misc queries) 1 September 8th 06 08:56 AM
Counting help caloy Excel Discussion (Misc queries) 2 February 28th 06 07:59 PM
Counting rows, then counting values. Michael via OfficeKB.com Excel Discussion (Misc queries) 7 August 4th 05 10:57 PM
Counting Help JerryS Excel Worksheet Functions 2 August 3rd 05 09:03 PM
Counting names in a column but counting duplicate names once TBoe Excel Discussion (Misc queries) 9 May 11th 05 11:24 PM


All times are GMT +1. The time now is 10:24 AM.

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

About Us

"It's about Microsoft Excel"