#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default Consecutive Numbers

Hi, again

data displayed as follows
Column A Column B Column D
1012 1013 1016

Is there a way to count how many consecutive numbers there are, so that when
the numbers change the consecutive count changes also??

Tks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default Consecutive Numbers

Can you provide a few more details?
Should blank cells be ignored?
Could the consecutive values be: 1012, 1013, blank, 1014?
or must they be in contiguous cells?
Will the values be in consecutive order?
Or is this considered a sequence: 1013, 1015, 1014?

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Hi, again

data displayed as follows
Column A Column B Column D
1012 1013 1016

Is there a way to count how many consecutive numbers there are, so that
when
the numbers change the consecutive count changes also??

Tks



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default Consecutive Numbers

Hi Ron

There will be no blank cells, and the number are in continuous cells and in
consecutive order

Tks for the help

"Ron Coderre" wrote:

Can you provide a few more details?
Should blank cells be ignored?
Could the consecutive values be: 1012, 1013, blank, 1014?
or must they be in contiguous cells?
Will the values be in consecutive order?
Or is this considered a sequence: 1013, 1015, 1014?

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Hi, again

data displayed as follows
Column A Column B Column D
1012 1013 1016

Is there a way to count how many consecutive numbers there are, so that
when
the numbers change the consecutive count changes also??

Tks




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default Consecutive Numbers

Thanks for the additional info....

Try something like this:

With
A1:G1 contains numbers in ascending order that
may, or may not, be consecutive.

Example:
A1: 4
B1: 6
C1: 7
D1: 8
E1: 10
F1: 15
G1: 16

This ARRAY FORMULA (committed with CTRL+SHIFT+ENTER, instead of just ENTER)
returns the maximum count of consecutive numbers:

In sections for readability..
=MAX(FREQUENCY(IF(A1:F1=(B1:G1-1),COLUMN(A1:F1)),
IF(A1:F1<(B1:G1-1),COLUMN(A1:F1))))+1

In the above example, the formula returns: 3
(6,7, and 8 are the longest run of consecutive numbers)

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Hi Ron

There will be no blank cells, and the number are in continuous cells and
in
consecutive order

Tks for the help

"Ron Coderre" wrote:

Can you provide a few more details?
Should blank cells be ignored?
Could the consecutive values be: 1012, 1013, blank, 1014?
or must they be in contiguous cells?
Will the values be in consecutive order?
Or is this considered a sequence: 1013, 1015, 1014?

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Hi, again

data displayed as follows
Column A Column B Column D
1012 1013 1016

Is there a way to count how many consecutive numbers there are, so that
when
the numbers change the consecutive count changes also??

Tks







  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default Consecutive Numbers

Tks Ron

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive numbers
1;3;5;7;9;11;13 returns result 1

Copied and pasted the formula and same was entered as an array

Rgds

"Ron Coderre" wrote:

Thanks for the additional info....

Try something like this:

With
A1:G1 contains numbers in ascending order that
may, or may not, be consecutive.

Example:
A1: 4
B1: 6
C1: 7
D1: 8
E1: 10
F1: 15
G1: 16

This ARRAY FORMULA (committed with CTRL+SHIFT+ENTER, instead of just ENTER)
returns the maximum count of consecutive numbers:

In sections for readability..
=MAX(FREQUENCY(IF(A1:F1=(B1:G1-1),COLUMN(A1:F1)),
IF(A1:F1<(B1:G1-1),COLUMN(A1:F1))))+1

In the above example, the formula returns: 3
(6,7, and 8 are the longest run of consecutive numbers)

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Hi Ron

There will be no blank cells, and the number are in continuous cells and
in
consecutive order

Tks for the help

"Ron Coderre" wrote:

Can you provide a few more details?
Should blank cells be ignored?
Could the consecutive values be: 1012, 1013, blank, 1014?
or must they be in contiguous cells?
Will the values be in consecutive order?
Or is this considered a sequence: 1013, 1015, 1014?

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Hi, again

data displayed as follows
Column A Column B Column D
1012 1013 1016

Is there a way to count how many consecutive numbers there are, so that
when
the numbers change the consecutive count changes also??

Tks









  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default Consecutive Numbers

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive numbers
1;3;5;7;9;11;13 returns result 1


I'm not sure if you're telling me the formula works....or doesn't work.

With those original values...what were you expecting to see?
Do you want to know how many consecutive values
there are anywhere in the data?
(6 for the first example: 1;2_6;7_10;11)
(1..or 0...for the second example?)

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Tks Ron

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive numbers
1;3;5;7;9;11;13 returns result 1

Copied and pasted the formula and same was entered as an array

Rgds

"Ron Coderre" wrote:

Thanks for the additional info....

Try something like this:

With
A1:G1 contains numbers in ascending order that
may, or may not, be consecutive.

Example:
A1: 4
B1: 6
C1: 7
D1: 8
E1: 10
F1: 15
G1: 16

This ARRAY FORMULA (committed with CTRL+SHIFT+ENTER, instead of just
ENTER)
returns the maximum count of consecutive numbers:

In sections for readability..
=MAX(FREQUENCY(IF(A1:F1=(B1:G1-1),COLUMN(A1:F1)),
IF(A1:F1<(B1:G1-1),COLUMN(A1:F1))))+1

In the above example, the formula returns: 3
(6,7, and 8 are the longest run of consecutive numbers)

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Hi Ron

There will be no blank cells, and the number are in continuous cells
and
in
consecutive order

Tks for the help

"Ron Coderre" wrote:

Can you provide a few more details?
Should blank cells be ignored?
Could the consecutive values be: 1012, 1013, blank, 1014?
or must they be in contiguous cells?
Will the values be in consecutive order?
Or is this considered a sequence: 1013, 1015, 1014?

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Hi, again

data displayed as follows
Column A Column B Column D
1012 1013 1016

Is there a way to count how many consecutive numbers there are, so
that
when
the numbers change the consecutive count changes also??

Tks










  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default Consecutive Numbers

Ron, doesn´t work

in the set:1;3;5;7;9;11;13 there are no consecutive numbers

"Ron Coderre" wrote:

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive numbers
1;3;5;7;9;11;13 returns result 1


I'm not sure if you're telling me the formula works....or doesn't work.

With those original values...what were you expecting to see?
Do you want to know how many consecutive values
there are anywhere in the data?
(6 for the first example: 1;2_6;7_10;11)
(1..or 0...for the second example?)

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Tks Ron

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive numbers
1;3;5;7;9;11;13 returns result 1

Copied and pasted the formula and same was entered as an array

Rgds

"Ron Coderre" wrote:

Thanks for the additional info....

Try something like this:

With
A1:G1 contains numbers in ascending order that
may, or may not, be consecutive.

Example:
A1: 4
B1: 6
C1: 7
D1: 8
E1: 10
F1: 15
G1: 16

This ARRAY FORMULA (committed with CTRL+SHIFT+ENTER, instead of just
ENTER)
returns the maximum count of consecutive numbers:

In sections for readability..
=MAX(FREQUENCY(IF(A1:F1=(B1:G1-1),COLUMN(A1:F1)),
IF(A1:F1<(B1:G1-1),COLUMN(A1:F1))))+1

In the above example, the formula returns: 3
(6,7, and 8 are the longest run of consecutive numbers)

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Hi Ron

There will be no blank cells, and the number are in continuous cells
and
in
consecutive order

Tks for the help

"Ron Coderre" wrote:

Can you provide a few more details?
Should blank cells be ignored?
Could the consecutive values be: 1012, 1013, blank, 1014?
or must they be in contiguous cells?
Will the values be in consecutive order?
Or is this considered a sequence: 1013, 1015, 1014?

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Hi, again

data displayed as follows
Column A Column B Column D
1012 1013 1016

Is there a way to count how many consecutive numbers there are, so
that
when
the numbers change the consecutive count changes also??

Tks











  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default Consecutive Numbers

I see what you mean.

So, maybe this ARRAY FORMULA:
=MAX(FREQUENCY(IF(A1:F1=(B1:G1-1),COLUMN(A1:F1)),
IF(A1:F1<(B1:G1-1),COLUMN(A1:F1))))+
(COUNT(1/(A1:F1=(B1:G1-1)))0)

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Ron, doesn´t work

in the set:1;3;5;7;9;11;13 there are no consecutive numbers

"Ron Coderre" wrote:

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive numbers
1;3;5;7;9;11;13 returns result 1


I'm not sure if you're telling me the formula works....or doesn't work.

With those original values...what were you expecting to see?
Do you want to know how many consecutive values
there are anywhere in the data?
(6 for the first example: 1;2_6;7_10;11)
(1..or 0...for the second example?)

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Tks Ron

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive numbers
1;3;5;7;9;11;13 returns result 1

Copied and pasted the formula and same was entered as an array

Rgds

"Ron Coderre" wrote:

Thanks for the additional info....

Try something like this:

With
A1:G1 contains numbers in ascending order that
may, or may not, be consecutive.

Example:
A1: 4
B1: 6
C1: 7
D1: 8
E1: 10
F1: 15
G1: 16

This ARRAY FORMULA (committed with CTRL+SHIFT+ENTER, instead of just
ENTER)
returns the maximum count of consecutive numbers:

In sections for readability..
=MAX(FREQUENCY(IF(A1:F1=(B1:G1-1),COLUMN(A1:F1)),
IF(A1:F1<(B1:G1-1),COLUMN(A1:F1))))+1

In the above example, the formula returns: 3
(6,7, and 8 are the longest run of consecutive numbers)

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Hi Ron

There will be no blank cells, and the number are in continuous cells
and
in
consecutive order

Tks for the help

"Ron Coderre" wrote:

Can you provide a few more details?
Should blank cells be ignored?
Could the consecutive values be: 1012, 1013, blank, 1014?
or must they be in contiguous cells?
Will the values be in consecutive order?
Or is this considered a sequence: 1013, 1015, 1014?

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Hi, again

data displayed as follows
Column A Column B Column D
1012 1013 1016

Is there a way to count how many consecutive numbers there are,
so
that
when
the numbers change the consecutive count changes also??

Tks














  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default Consecutive Numbers

Ron

If I change for the following nrs:
1,2,3,4,5,6,7... the result is 5
so, once again it doesn't work

Tks



"Ron Coderre" wrote:

I see what you mean.

So, maybe this ARRAY FORMULA:
=MAX(FREQUENCY(IF(A1:F1=(B1:G1-1),COLUMN(A1:F1)),
IF(A1:F1<(B1:G1-1),COLUMN(A1:F1))))+
(COUNT(1/(A1:F1=(B1:G1-1)))0)

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Ron, doesn´t work

in the set:1;3;5;7;9;11;13 there are no consecutive numbers

"Ron Coderre" wrote:

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive numbers
1;3;5;7;9;11;13 returns result 1

I'm not sure if you're telling me the formula works....or doesn't work.

With those original values...what were you expecting to see?
Do you want to know how many consecutive values
there are anywhere in the data?
(6 for the first example: 1;2_6;7_10;11)
(1..or 0...for the second example?)

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Tks Ron

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive numbers
1;3;5;7;9;11;13 returns result 1

Copied and pasted the formula and same was entered as an array

Rgds

"Ron Coderre" wrote:

Thanks for the additional info....

Try something like this:

With
A1:G1 contains numbers in ascending order that
may, or may not, be consecutive.

Example:
A1: 4
B1: 6
C1: 7
D1: 8
E1: 10
F1: 15
G1: 16

This ARRAY FORMULA (committed with CTRL+SHIFT+ENTER, instead of just
ENTER)
returns the maximum count of consecutive numbers:

In sections for readability..
=MAX(FREQUENCY(IF(A1:F1=(B1:G1-1),COLUMN(A1:F1)),
IF(A1:F1<(B1:G1-1),COLUMN(A1:F1))))+1

In the above example, the formula returns: 3
(6,7, and 8 are the longest run of consecutive numbers)

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Hi Ron

There will be no blank cells, and the number are in continuous cells
and
in
consecutive order

Tks for the help

"Ron Coderre" wrote:

Can you provide a few more details?
Should blank cells be ignored?
Could the consecutive values be: 1012, 1013, blank, 1014?
or must they be in contiguous cells?
Will the values be in consecutive order?
Or is this considered a sequence: 1013, 1015, 1014?

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Hi, again

data displayed as follows
Column A Column B Column D
1012 1013 1016

Is there a way to count how many consecutive numbers there are,
so
that
when
the numbers change the consecutive count changes also??

Tks















  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default Consecutive Numbers

There's something wrong with your formula....
I copied the formula from my post and pasted it into my worksheet.

Using 1;2;3;4;5;6;7 in cells A1:G1,
the formula returns: 7

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Ron

If I change for the following nrs:
1,2,3,4,5,6,7... the result is 5
so, once again it doesn't work

Tks



"Ron Coderre" wrote:

I see what you mean.

So, maybe this ARRAY FORMULA:
=MAX(FREQUENCY(IF(A1:F1=(B1:G1-1),COLUMN(A1:F1)),
IF(A1:F1<(B1:G1-1),COLUMN(A1:F1))))+
(COUNT(1/(A1:F1=(B1:G1-1)))0)

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Ron, doesn´t work

in the set:1;3;5;7;9;11;13 there are no consecutive numbers

"Ron Coderre" wrote:

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive
numbers
1;3;5;7;9;11;13 returns result 1

I'm not sure if you're telling me the formula works....or doesn't
work.

With those original values...what were you expecting to see?
Do you want to know how many consecutive values
there are anywhere in the data?
(6 for the first example: 1;2_6;7_10;11)
(1..or 0...for the second example?)

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Tks Ron

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive
numbers
1;3;5;7;9;11;13 returns result 1

Copied and pasted the formula and same was entered as an array

Rgds

"Ron Coderre" wrote:

Thanks for the additional info....

Try something like this:

With
A1:G1 contains numbers in ascending order that
may, or may not, be consecutive.

Example:
A1: 4
B1: 6
C1: 7
D1: 8
E1: 10
F1: 15
G1: 16

This ARRAY FORMULA (committed with CTRL+SHIFT+ENTER, instead of
just
ENTER)
returns the maximum count of consecutive numbers:

In sections for readability..
=MAX(FREQUENCY(IF(A1:F1=(B1:G1-1),COLUMN(A1:F1)),
IF(A1:F1<(B1:G1-1),COLUMN(A1:F1))))+1

In the above example, the formula returns: 3
(6,7, and 8 are the longest run of consecutive numbers)

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Hi Ron

There will be no blank cells, and the number are in continuous
cells
and
in
consecutive order

Tks for the help

"Ron Coderre" wrote:

Can you provide a few more details?
Should blank cells be ignored?
Could the consecutive values be: 1012, 1013, blank, 1014?
or must they be in contiguous cells?
Will the values be in consecutive order?
Or is this considered a sequence: 1013, 1015, 1014?

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Hi, again

data displayed as follows
Column A Column B Column D
1012 1013 1016

Is there a way to count how many consecutive numbers there
are,
so
that
when
the numbers change the consecutive count changes also??

Tks



















  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default Consecutive Numbers

Ron, your right, had something wrong

Tks very much for your precious help

Rgds

"Ron Coderre" wrote:

There's something wrong with your formula....
I copied the formula from my post and pasted it into my worksheet.

Using 1;2;3;4;5;6;7 in cells A1:G1,
the formula returns: 7

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Ron

If I change for the following nrs:
1,2,3,4,5,6,7... the result is 5
so, once again it doesn't work

Tks



"Ron Coderre" wrote:

I see what you mean.

So, maybe this ARRAY FORMULA:
=MAX(FREQUENCY(IF(A1:F1=(B1:G1-1),COLUMN(A1:F1)),
IF(A1:F1<(B1:G1-1),COLUMN(A1:F1))))+
(COUNT(1/(A1:F1=(B1:G1-1)))0)

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Ron, doesn´t work

in the set:1;3;5;7;9;11;13 there are no consecutive numbers

"Ron Coderre" wrote:

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive
numbers
1;3;5;7;9;11;13 returns result 1

I'm not sure if you're telling me the formula works....or doesn't
work.

With those original values...what were you expecting to see?
Do you want to know how many consecutive values
there are anywhere in the data?
(6 for the first example: 1;2_6;7_10;11)
(1..or 0...for the second example?)

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Tks Ron

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive
numbers
1;3;5;7;9;11;13 returns result 1

Copied and pasted the formula and same was entered as an array

Rgds

"Ron Coderre" wrote:

Thanks for the additional info....

Try something like this:

With
A1:G1 contains numbers in ascending order that
may, or may not, be consecutive.

Example:
A1: 4
B1: 6
C1: 7
D1: 8
E1: 10
F1: 15
G1: 16

This ARRAY FORMULA (committed with CTRL+SHIFT+ENTER, instead of
just
ENTER)
returns the maximum count of consecutive numbers:

In sections for readability..
=MAX(FREQUENCY(IF(A1:F1=(B1:G1-1),COLUMN(A1:F1)),
IF(A1:F1<(B1:G1-1),COLUMN(A1:F1))))+1

In the above example, the formula returns: 3
(6,7, and 8 are the longest run of consecutive numbers)

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Hi Ron

There will be no blank cells, and the number are in continuous
cells
and
in
consecutive order

Tks for the help

"Ron Coderre" wrote:

Can you provide a few more details?
Should blank cells be ignored?
Could the consecutive values be: 1012, 1013, blank, 1014?
or must they be in contiguous cells?
Will the values be in consecutive order?
Or is this considered a sequence: 1013, 1015, 1014?

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Hi, again

data displayed as follows
Column A Column B Column D
1012 1013 1016

Is there a way to count how many consecutive numbers there
are,
so
that
when
the numbers change the consecutive count changes also??

Tks


















  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default Consecutive Numbers

Thanks for the update! I'm glad you got it working.
I didn't know WHAT else to recommend.

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Ron, your right, had something wrong

Tks very much for your precious help

Rgds

"Ron Coderre" wrote:

There's something wrong with your formula....
I copied the formula from my post and pasted it into my worksheet.

Using 1;2;3;4;5;6;7 in cells A1:G1,
the formula returns: 7

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Ron

If I change for the following nrs:
1,2,3,4,5,6,7... the result is 5
so, once again it doesn't work

Tks



"Ron Coderre" wrote:

I see what you mean.

So, maybe this ARRAY FORMULA:
=MAX(FREQUENCY(IF(A1:F1=(B1:G1-1),COLUMN(A1:F1)),
IF(A1:F1<(B1:G1-1),COLUMN(A1:F1))))+
(COUNT(1/(A1:F1=(B1:G1-1)))0)

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in message
...
Ron, doesn´t work

in the set:1;3;5;7;9;11;13 there are no consecutive numbers

"Ron Coderre" wrote:

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive
numbers
1;3;5;7;9;11;13 returns result 1

I'm not sure if you're telling me the formula works....or doesn't
work.

With those original values...what were you expecting to see?
Do you want to know how many consecutive values
there are anywhere in the data?
(6 for the first example: 1;2_6;7_10;11)
(1..or 0...for the second example?)

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Tks Ron

When I change the values for:
1;2;6;7;10;11;14 returns 2 as a result, and if no consecutive
numbers
1;3;5;7;9;11;13 returns result 1

Copied and pasted the formula and same was entered as an array

Rgds

"Ron Coderre" wrote:

Thanks for the additional info....

Try something like this:

With
A1:G1 contains numbers in ascending order that
may, or may not, be consecutive.

Example:
A1: 4
B1: 6
C1: 7
D1: 8
E1: 10
F1: 15
G1: 16

This ARRAY FORMULA (committed with CTRL+SHIFT+ENTER, instead of
just
ENTER)
returns the maximum count of consecutive numbers:

In sections for readability..
=MAX(FREQUENCY(IF(A1:F1=(B1:G1-1),COLUMN(A1:F1)),
IF(A1:F1<(B1:G1-1),COLUMN(A1:F1))))+1

In the above example, the formula returns: 3
(6,7, and 8 are the longest run of consecutive numbers)

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Antonio" wrote in message
...
Hi Ron

There will be no blank cells, and the number are in continuous
cells
and
in
consecutive order

Tks for the help

"Ron Coderre" wrote:

Can you provide a few more details?
Should blank cells be ignored?
Could the consecutive values be: 1012, 1013, blank, 1014?
or must they be in contiguous cells?
Will the values be in consecutive order?
Or is this considered a sequence: 1013, 1015, 1014?

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Antonio" wrote in
message
...
Hi, again

data displayed as follows
Column A Column B Column D
1012 1013 1016

Is there a way to count how many consecutive numbers there
are,
so
that
when
the numbers change the consecutive count changes also??

Tks




















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
consecutive numbers Phippsy Excel Worksheet Functions 14 September 9th 07 01:56 PM
how to add consecutive positive numbers shreen_farhad Excel Discussion (Misc queries) 1 October 2nd 05 07:51 PM
generate consecutive numbers Mark New Users to Excel 6 March 15th 05 06:45 PM
consecutive numbers Monique Excel Worksheet Functions 8 March 7th 05 05:09 AM
Count Consecutive Numbers in a Row Sam via OfficeKB.com Excel Worksheet Functions 5 February 19th 05 02:49 AM


All times are GMT +1. The time now is 12:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"