Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Tuc
 
Posts: n/a
Default Counting rows with 3 columns

Hi,

I have three colums and I need to perform some counting but can't quite get
it right. Each column could possibly contain a single character, 'Y' or
nothing at all. I need to count the rows where the character 'Y' is present
in at least one column. In other words, if a 'Y' occurs anywhere in a row, I
want to count that row. Thanks in advance!
  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way:

=SUMPRODUCT(--NOT(ISERR(SEARCH("Y",A1:A100&B1:B100&C1:C100))))

In article ,
Tuc wrote:

Hi,

I have three colums and I need to perform some counting but can't quite get
it right. Each column could possibly contain a single character, 'Y' or
nothing at all. I need to count the rows where the character 'Y' is present
in at least one column. In other words, if a 'Y' occurs anywhere in a row, I
want to count that row. Thanks in advance!

  #3   Report Post  
Domenic
 
Posts: n/a
Default

Assuming that Columns A, B, and C contain your data, try...

=SUMPRODUCT(--(COUNTIF(OFFSET(A1:C10,ROW(A1:C10)-MIN(ROW(A1:C9)),0,1),"Y"
)0))

....or the following formulas I picked up from Daniel M....

=SUMPRODUCT(--(MMULT(--(A1:C10="Y"),{1;1;1})0))

....confirmed with just ENTER, and

=SUMPRODUCT(--(MMULT(--(A1:C10="Y"),TRANSPOSE(COLUMN(A1:C10))*0+1)0))

....confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!

In article ,
Tuc wrote:

Hi,

I have three colums and I need to perform some counting but can't quite get
it right. Each column could possibly contain a single character, 'Y' or
nothing at all. I need to count the rows where the character 'Y' is present
in at least one column. In other words, if a 'Y' occurs anywhere in a row, I
want to count that row. Thanks in advance!

  #4   Report Post  
Domenic
 
Posts: n/a
Default

Correction...

=SUM(--(MMULT(--(A1:C10="Y"),TRANSPOSE(COLUMN(A1:C10))*0+1)0))

....confirmed with CONTROL+SHIFT+ENTER.

In article ,
Domenic wrote:

=SUMPRODUCT(--(MMULT(--(A1:C10="Y"),TRANSPOSE(COLUMN(A1:C10))*0+1)0))

...confirmed with CONTROL+SHIFT+ENTER.

  #5   Report Post  
Ron Coderre
 
Posts: n/a
Default

I think this'll do what you're asking:
=SUMPRODUCT(--(LEFT(A1:A100&B1:B100&C1:C100,1)="Y"))

Regards,
Ron
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
hidden rows & columns slow file open Simon Shaw Excel Discussion (Misc queries) 0 April 5th 05 12:21 AM
Removing Near-Duplicate Rows, Leaving Those w/Most Data in Specific Columns foofoo Excel Discussion (Misc queries) 1 April 2nd 05 12:02 AM
How to keep rows together when sorting columns? Amit Excel Worksheet Functions 1 March 28th 05 06:01 PM
Convert multiple columns to rows Lois Lane Excel Worksheet Functions 8 January 10th 05 12:47 AM
interchange columns with rows Herman Excel Discussion (Misc queries) 2 December 8th 04 05:40 PM


All times are GMT +1. The time now is 01:35 PM.

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"