Count Instances Since Last Non-Zero Value in Other Column

khammer

New Member
Joined
Feb 10, 2014
Messages
15
I would like to count the number of occurrences of each Item type in column A since the last non-zero value in the Failures column. Each case of a failure effectively resets the counter for that item type.

The desired example result is in bold below. Your input is appreciated.

[TABLE="width: 363"]
<colgroup><col span="3"><col></colgroup><tbody>[TR]
[TD]Item[/TD]
[TD]Irrelevant [/TD]
[TD]Failures[/TD]
[TD]Instances Since Last Failure[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]4[/TD]
[TD]0[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]2[/TD]
[TD]0[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]6[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]2[/TD]
[TD]0[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]6[/TD]
[TD]0[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]5[/TD]
[TD]0[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try this, copied down.

Excel Workbook
ACD
1ItemFailuresSince Last Failure
2C01
3B01
4A10
5C20
6C01
7B02
8A01
9C02
Count since failure
 
Upvote 0
Peter,

I wish to thank you for a most elegant solution!

I am very thankful for your level of contribution, as well as my new knowledge of Aggregate.

K
 
Upvote 0
You're welcome, and thanks for your kind remarks. :)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top