Counting how much number is in ascending order in a row.

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,422
Office Version
  1. 2010
Using Excel 2010
Hello,

I need a Formula or VBA which can count numbers are ascending order in a row. From the 1st starting number, for example…..

Row1 (4-7-8-10) =4, row2 (4-7-18) =3, row3 (4-7) =2, row5 (4-7-8-10-39) =5

n1n2n3n4n5Ans
4781094
47181093
471210292
47810395

Regards,
Moti
 
Thanks for the clarification. Try this

24 02 26.xlsm
ABCDEF
1n1n2n3n4n5Ans
24781094
347181093
4471210293
547810395
6151210871
7476892
821212131410
921212234450
1021222235410
1121242439440
1221212121490
1326262929480
1421223434450
1521221818450
1621222218480
Ascending (2)
Cell Formulas
RangeFormula
F2:F16F2=IFERROR(MATCH(TRUE,B2:E2<A2:D2,0),5)*(MAX(COUNTIF(A2:E2,A2:E2))=1)
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 1
Solution

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Thanks for the clarification. Try this

24 02 26.xlsm
ABCDEF
1n1n2n3n4n5Ans
24781094
347181093
4471210293
547810395
6151210871
7476892
821212131410
921212234450
1021222235410
1121242439440
1221212121490
1326262929480
1421223434450
1521221818450
1621222218480
Ascending (2)
Cell Formulas
RangeFormula
F2:F16F2=IFERROR(MATCH(TRUE,B2:E2<A2:D2,0),5)*(MAX(COUNTIF(A2:E2,A2:E2))=1)
Press CTRL+SHIFT+ENTER to enter array formulas.
Peter_SSs, you made my day thank you for giving a perfect solution for my second request.

I appreciate the help and the time you spent. 🙏

I wish for you have a good time and good luck.

Kind Regards,
Moti :)
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

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