Counting ascending and falling numbers in a row

bilbon

Board Regular
Joined
Dec 19, 2011
Messages
83
Hi
I would like to count ascending and falling numbers in a row from a row of 13 numbers.
I want to count 3 numbers in a row and 4 numbers in a row.
3 numbers in a row can come in 11 different places and 4 numbers in a row in 10 different places. I just need the numbers and not the combinations.

<colgroup><col><col><col><col><col></colgroup><tbody>

</tbody>



Rising numbers in a rowFalling numbers in a row
3 in a row4 in a row 3 in a row4 in a row
236131023248155201211321

<colgroup><col span="13"><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Try:

Excel 2012
ABCDEFGHIJKLMNOPQRS
1RisingFalling
23 in a row4 in a row34
32361310232481552012113210

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet7

Array Formulas
CellFormula
O3{=SUM(IF((A3:K3<B3:L3)*(B3:L3<C3:M3),1))}
P3{=SUM(IF((A3:J3<B3:K3)*(B3:K3<C3:L3)*(C3:L3<D3:M3),1))}
R3{=SUM(IF((A3:K3>B3:L3)*(B3:L3>C3:M3),1))}
S3{=SUM(IF((A3:J3>B3:K3)*(B3:K3>C3:L3)*(C3:L3>D3:M3),1))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0
Hi Eric


As usual, I am bad to explainin what I want help with. I am sorry for that.


What I want is the number of combinations that are 3 numbers long and rising and in a row.
In O3 the answer must be 3 and the combinations that exist are 1-3-10,3-10-23,10-23-24.


In P3 the answer must be 2 and the combinations that exist are 1-3-10-23 and 3-10-23-24.


Here I want the number of combinations that are 4 numbers long and falling and in a row.
In R3, the answer must be 1 and the combination that exists is 20-12-11


In S3, the answer is 0 since there is no combination.

/Bilbon
 
Upvote 0
The board has chewed up the first 2 formulae that Eric supplied. Try

Excel 2013/2016
ABCDEFGHIJKLMNOPQR
1Rising numbers in a rowFalling numbers in a row
23 in a row4 in a row3 in a row4 in a row
32361310232481552012113210
sheet1
Cell Formulas
RangeFormula
O3{=SUM(IF((A3:K3)*(B3:L3),1))}
P3{=SUM(IF((A3:J3< B3:K3)*(B3:K3< C3:L3)*(C3:L3< D3:M3),1))}
Q3{=SUM(IF((A3:K3>B3:L3)*(B3:L3>C3:M3),1))}
R3{=SUM(IF((A3:J3>B3:K3)*(B3:K3>C3:L3)*(C3:L3>D3:M3),1))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hi Fluff and Eric


Thank you for your suggestions.
Fluff your suggestion works just like I wanted, very grateful.
Eric boring you had to put time because of my ambiguity but thankful for your help too


/Bilbon
 
Upvote 0
It's actually Eric's formula not mine.
Sometimes the software interprets < & > signs as HTML & therefore mucks the formula.
 
Upvote 0
Aargh! You'd think I'd learn by now. Maybe I'll take a look at the HTML Maker and see if it can automatically add the spaces as needed.

Bilbon, I'm glad that works for you.

Fluff, thanks for showing the complete formulas.
 
Upvote 0
Eric, it only affects the < symbol followed by a letter and another option is to replace the < symbol with &lt ; (without the space) which will display < and the rest of the formula correctly.
 
Last edited:
Upvote 0
Eric, it only affects the < symbol followed by a letter and another option is to replace the < symbol with &lt ; (without the space) which will display < and the rest of the formula correctly.
@MARK858

Thanks for this clear explanation ... :)
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,638
Members
449,093
Latest member
Ahmad123098

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