Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default Count Data in Series

Hi,

I'm trying to write a formula that will go down a column and count the
number of one value cells that occur between those of another value. For
example, given:

P
S
S
P
S
S
S
S
P
P
S
P

in column A, I'd like a formula in column B that gives:

P
S
S
P 2
S
S
S
S
P 4
P 0
S
P 1

I want the columns opposite the "S" to remain empty. I've been playing with
the =FREQUENCY function, but haven't been able to figure it out.

Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default Count Data in Series

Demosthenes wrote:
Hi,

I'm trying to write a formula that will go down a column and count the
number of one value cells that occur between those of another value. For
example, given:

P
S
S
P
S
S
S
S
P
P
S
P

in column A, I'd like a formula in column B that gives:

P
S
S
P 2
S
S
S
S
P 4
P 0
S
P 1

I want the columns opposite the "S" to remain empty. I've been playing with
the =FREQUENCY function, but haven't been able to figure it out.

Thanks,



Assuming your data is in A1:A12, put the following in B2 and copy down:

=IF(A2="P",COUNTIF($A$1:A2,"S")-SUM($B$1:B1),"")
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 506
Default Count Data in Series

Paste this formula in B1 cell
=IF(IF(A1="P",COUNTIF($A$1:$A1,"S"),"")=0,"",IF(A2 ="P",COUNTIF($A$1:$A2,"S"),""))

Paste this formula in B2 cell
=IF(ISNUMBER(IF(A2="P",COUNTIF($A$1:$A2,"S"),"")), IF(A2="P",COUNTIF($A$1:$A2,"S"),"")-SUM($B$1:$B1),IF(A2="P",COUNTIF($A$1:$A2,"S"),""))

Copy the B2 cell and paste it for the remaining cells of B Column

--
Remember to Click Yes, if this post helps!

--------------------
(Ms-Exl-Learner)
--------------------


"Demosthenes" wrote:

Hi,

I'm trying to write a formula that will go down a column and count the
number of one value cells that occur between those of another value. For
example, given:

P
S
S
P
S
S
S
S
P
P
S
P

in column A, I'd like a formula in column B that gives:

P
S
S
P 2
S
S
S
S
P 4
P 0
S
P 1

I want the columns opposite the "S" to remain empty. I've been playing with
the =FREQUENCY function, but haven't been able to figure it out.

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
Time Series and Creating data points within a series Cristal Excel Discussion (Misc queries) 2 November 30th 09 08:07 PM
chart with two data series and two colors for each data series bikash Charts and Charting in Excel 0 January 17th 08 02:04 AM
2nd Axes - primary series data of only 1 series disappears! cheriw Charts and Charting in Excel 1 February 23rd 06 12:32 AM
how do I plot a data series against two series Frustrated in Sydney Charts and Charting in Excel 7 February 16th 06 04:24 AM
chart data series -- plot a table as a single series hjc Charts and Charting in Excel 7 September 20th 05 05:52 PM


All times are GMT +1. The time now is 07:42 PM.

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

About Us

"It's about Microsoft Excel"