Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Count Consecutive Values

Is there a way to count consecutive values in a column? Preferably I'd prefer
to only count strings that are at least 5 values long. For Example:

Column A Column B
JETS
JETS
JETS
JETS
JETS
JETS 6
CARS
CARS
CARS
CARS
JETS
CARS
JETS


In this example Column A is my data values, and Column B is "helper" column
that counts a consecutive string and identifies it at the end of the string
(A6 is the end of the JETS run, so B6 identifies the string as 6 values long).

Any help would be appreciated. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Count Consecutive Values

Hi,

Put this in b1 and drag down

=IF(COUNTIF($A$1:A1,A1)5,COUNTIF($A$1:A1,A1),"")

Mike

"The Question guy" wrote:

Is there a way to count consecutive values in a column? Preferably I'd prefer
to only count strings that are at least 5 values long. For Example:

Column A Column B
JETS
JETS
JETS
JETS
JETS
JETS 6
CARS
CARS
CARS
CARS
JETS
CARS
JETS


In this example Column A is my data values, and Column B is "helper" column
that counts a consecutive string and identifies it at the end of the string
(A6 is the end of the JETS run, so B6 identifies the string as 6 values long).

Any help would be appreciated. Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default Count Consecutive Values

Thought that'd be good, but it doesn't account for consecutive. Would show 6,
7 and 8 in the below, but thinking the OP only wants 6 then start over at 1
for the next.

Still working on this one myself...

"Mike H" wrote:

Hi,

Put this in b1 and drag down

=IF(COUNTIF($A$1:A1,A1)5,COUNTIF($A$1:A1,A1),"")

Mike

"The Question guy" wrote:

Is there a way to count consecutive values in a column? Preferably I'd prefer
to only count strings that are at least 5 values long. For Example:

Column A Column B
JETS
JETS
JETS
JETS
JETS
JETS 6
CARS
CARS
CARS
CARS
JETS
CARS
JETS


In this example Column A is my data values, and Column B is "helper" column
that counts a consecutive string and identifies it at the end of the string
(A6 is the end of the JETS run, so B6 identifies the string as 6 values long).

Any help would be appreciated. Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default Count Consecutive Values

Perhaps with 2 helpers..

in B2, 1

in B3, =if(A3=A2,B2+1,1)

copy B3 to bottom

in C2, =if(AND(B25,B3=1),B2,"")

How does that one do?

"The Question guy" wrote:

Is there a way to count consecutive values in a column? Preferably I'd prefer
to only count strings that are at least 5 values long. For Example:

Column A Column B
JETS
JETS
JETS
JETS
JETS
JETS 6
CARS
CARS
CARS
CARS
JETS
CARS
JETS


In this example Column A is my data values, and Column B is "helper" column
that counts a consecutive string and identifies it at the end of the string
(A6 is the end of the JETS run, so B6 identifies the string as 6 values long).

Any help would be appreciated. Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Count Consecutive Values

The key is, I've got almost 10,000 rows of data and I need to be able to
identify every string (of 5 values or greater) within those 10,000 rows.

In addition, I need to be able to indentify any kind of string. Using my
previous example I could have a string of 8 JETS and then several rows later
have a string of 5 CARS. In that instance I only want column B to return 2
numbers 8 and 5.


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default Count Consecutive Values

Understood, but not sure we can get you there without using another column.
The B column could be hidden, so you'd only see the column with your 8 and 5
(column C in my example). But to put both portions in 1 formula may take lots
of formulating...

"The Question guy" wrote:

The key is, I've got almost 10,000 rows of data and I need to be able to
identify every string (of 5 values or greater) within those 10,000 rows.

In addition, I need to be able to indentify any kind of string. Using my
previous example I could have a string of 8 JETS and then several rows later
have a string of 5 CARS. In that instance I only want column B to return 2
numbers 8 and 5.

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Count Consecutive Values

Sorry Sean, I hadn't refreshed so I didn't see your responses yet.

I tried them, and it worked perfectly! Thanks!

"Sean Timmons" wrote:

Perhaps with 2 helpers..

in B2, 1

in B3, =if(A3=A2,B2+1,1)

copy B3 to bottom

in C2, =if(AND(B25,B3=1),B2,"")

How does that one do?

"The Question guy" wrote:

Is there a way to count consecutive values in a column? Preferably I'd prefer
to only count strings that are at least 5 values long. For Example:

Column A Column B
JETS
JETS
JETS
JETS
JETS
JETS 6
CARS
CARS
CARS
CARS
JETS
CARS
JETS


In this example Column A is my data values, and Column B is "helper" column
that counts a consecutive string and identifies it at the end of the string
(A6 is the end of the JETS run, so B6 identifies the string as 6 values long).

Any help would be appreciated. Thanks!

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default Count Consecutive Values

Excellent! :-)

Happy to help!

"The Question guy" wrote:

Sorry Sean, I hadn't refreshed so I didn't see your responses yet.

I tried them, and it worked perfectly! Thanks!

"Sean Timmons" wrote:

Perhaps with 2 helpers..

in B2, 1

in B3, =if(A3=A2,B2+1,1)

copy B3 to bottom

in C2, =if(AND(B25,B3=1),B2,"")

How does that one do?

"The Question guy" wrote:

Is there a way to count consecutive values in a column? Preferably I'd prefer
to only count strings that are at least 5 values long. For Example:

Column A Column B
JETS
JETS
JETS
JETS
JETS
JETS 6
CARS
CARS
CARS
CARS
JETS
CARS
JETS


In this example Column A is my data values, and Column B is "helper" column
that counts a consecutive string and identifies it at the end of the string
(A6 is the end of the JETS run, so B6 identifies the string as 6 values long).

Any help would be appreciated. Thanks!

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
Exclude #N/A values and Return Numeric values to consecutive cells in Single Row Sam via OfficeKB.com Excel Worksheet Functions 5 February 9th 08 03:07 AM
Count & Sum Consecutive (2x) appearance of Specific Numeric Values Sam via OfficeKB.com Excel Worksheet Functions 2 February 5th 07 02:44 PM
Return Summed Count of Multiple Consecutive Numeric Values Sam via OfficeKB.com Excel Worksheet Functions 4 April 10th 06 10:35 PM
Count Intervals of 2 Consecutive Values in same Row and Return Count across Row Sam via OfficeKB.com Excel Worksheet Functions 6 November 29th 05 03:27 PM
Count consecutive repeted values sparclight Excel Discussion (Misc queries) 4 August 4th 05 06:49 PM


All times are GMT +1. The time now is 02:15 AM.

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"