Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Rowan
 
Posts: n/a
Default Count cells in range that restarts at intervals

The -- is a double unary minus which forces the Sumproduct function to
Convert True and False answers to 1's and 0's. More confused now?

There is a great explanation of Sumproduct at
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

and further explanation of the double unary minus from Bob Phillips and
Harlan Grove at
http://tinyurl.com/bv42x

Hope this helps
Rowan

"Melissa" wrote:

Fantastic! Worked like a charm...
but can you explain what the "--" means?

"Rowan" wrote:

If you data starts in Row 2 with the Names in column A and the Y/N in column
B then in C2 put the formula:

=SUMPRODUCT(--($A$2:A2=A2),--($B$2:B2="Y"))

and copy down.

Hope this helps
Rowan

"Melissa" wrote:

I have a table like this:
Row Name Y/N? No. of Y
1 Adam Y 1
2 Adam Y 2
3 Adam N 2
4 Adam N 2
1 Brian Y 1
2 Brian N 1
3 Brian N 1
4 Brian Y 2

Is there a formula I can put for "No. of Y" that counts the no. of times "Y"
appears for Adam from the first "Adam" row up to the current row? The
counting should restart for Brian and not accumulate from Adam's total.

Note that the starting point for each person is when "Row" = 1.

Can a pivot table help?

  #2   Report Post  
Rowan
 
Posts: n/a
Default

If you data starts in Row 2 with the Names in column A and the Y/N in column
B then in C2 put the formula:

=SUMPRODUCT(--($A$2:A2=A2),--($B$2:B2="Y"))

and copy down.

Hope this helps
Rowan

"Melissa" wrote:

I have a table like this:
Row Name Y/N? No. of Y
1 Adam Y 1
2 Adam Y 2
3 Adam N 2
4 Adam N 2
1 Brian Y 1
2 Brian N 1
3 Brian N 1
4 Brian Y 2

Is there a formula I can put for "No. of Y" that counts the no. of times "Y"
appears for Adam from the first "Adam" row up to the current row? The
counting should restart for Brian and not accumulate from Adam's total.

Note that the starting point for each person is when "Row" = 1.

Can a pivot table help?

  #3   Report Post  
Melissa
 
Posts: n/a
Default

Fantastic! Worked like a charm...
but can you explain what the "--" means?

"Rowan" wrote:

If you data starts in Row 2 with the Names in column A and the Y/N in column
B then in C2 put the formula:

=SUMPRODUCT(--($A$2:A2=A2),--($B$2:B2="Y"))

and copy down.

Hope this helps
Rowan

"Melissa" wrote:

I have a table like this:
Row Name Y/N? No. of Y
1 Adam Y 1
2 Adam Y 2
3 Adam N 2
4 Adam N 2
1 Brian Y 1
2 Brian N 1
3 Brian N 1
4 Brian Y 2

Is there a formula I can put for "No. of Y" that counts the no. of times "Y"
appears for Adam from the first "Adam" row up to the current row? The
counting should restart for Brian and not accumulate from Adam's total.

Note that the starting point for each person is when "Row" = 1.

Can a pivot table help?

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
Sorting a range of cells that get value from other cells Matt Caswell Excel Discussion (Misc queries) 3 July 13th 05 04:52 PM
adding the same prefix or suffix to a range of cells Betty Turvy Excel Discussion (Misc queries) 5 July 12th 05 05:13 PM
Count Position of Filtered TEXT cells in a column Sam via OfficeKB.com Excel Worksheet Functions 8 May 18th 05 04:23 AM
Count cells in one range based on parameters in another range dave roth Excel Worksheet Functions 2 March 29th 05 05:33 PM
Formula help for using a range of cells! Sukismomma Excel Worksheet Functions 5 January 27th 05 02:34 AM


All times are GMT +1. The time now is 11:38 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"