LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 747
Default How to calculate gaps between events?

Try this

Col A - has "yes", "no"

In Col B - cell B1 put 1 and drag it down, use fill series
( 1,2,3,4,5,6.....)

In Col C - in Cell C2 put this formula =IF(A2="yes",B2-B1,"")

Now use Sorting, Sort Col A for Decending Order, all the "yes" will
on top and

In Col C you will have results, use MAX(C1:C6) and MIN(C1:C6), then u
can paste special to values,

Again Sort Col B - Ascending order to get back original position.




On Aug 23, 8:42*pm, Kelvin wrote:
If there's a column with 100 "yes" or "no". I wanna calc the number of gaps
between each yes.

For example:
A1=yes
A2=no
A3=no
A4=yes
A5=no
A6=yes

Therefore, the output i wanna achieve is there is a maximum of 3 gaps
between the yes and no (between A1 to A4) while the minimum gaps will be 2
(A4 to A6)


 
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
Dates - gaps between gecko123 Excel Discussion (Misc queries) 3 August 19th 08 06:59 PM
Transpose Column With Gaps to Column With no gaps Vincent Excel Discussion (Misc queries) 9 October 1st 07 01:50 PM
How can I calculate events that happened at the same time? Stuboy28 Excel Discussion (Misc queries) 2 February 28th 07 09:06 PM
Calculate % of events based on days worked Karen Excel Worksheet Functions 1 January 23rd 07 04:25 AM
Transpose Column With Gaps to Row With No Gaps? SteveC Excel Discussion (Misc queries) 5 June 18th 05 01:01 AM


All times are GMT +1. The time now is 12:57 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"