Suming consecutive numbers greater than a value

dkm06

New Member
Joined
Mar 29, 2014
Messages
4
Hi all, I m presented a problem that I can describe in this way: In A column of numbers, sum only where the formula registers 5 consecutive numbers that are greater than 2 and tabulate the sum of that sequence in column b next to the last counted number greater than 2 in that sequence, example of set up below. For example if there are only 4 consecutive numbers greater than 2 in a sequence, that sequence is ignored. Thank you for your help,

[TABLE="width: 152"]
<tbody>[TR]
[TD][TABLE="width: 250"]
<tbody>[TR]
[TD]A
[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]21[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]23[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited by a moderator:
Rick,

The way i understood:
21 is the sum of 6 numbers because in the first sequence all numbers are greater than 2. On the other hand, 23 is the sum of only 5 numbers because 1 is not greater than 2, so it should not be included in the sum.

In other words: the first sequence begins in A2 and has, in fact, 6 numbers greater than 2; the second sequence begins in A10 and has only 5 numbers.

Not sure i'm right :confused:
Hmm, you are correct... I forgot about the "greater than 2" when I looked at the OP's numbers. Still, the OP's adding the 5 consecutive number criteria did seem to make the overall objective less clear. Not sure I can rework my current formula to handle a possibly unlimited sequence... I'll have to think about it.
 
Last edited:
Upvote 0

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi Ron,

Thank you for your reply, your formula worked perfectly indeed, although I still have to figure out the way the formula works :). Thanks again
 
Upvote 0

Forum statistics

Threads
1,224,112
Messages
6,176,442
Members
452,728
Latest member
mihael546

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