Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default looping puzzle

Hi,

new to VB, just a quick one I have a worsheet that contains 3 columns

column 1 = 4am to 10.30pm in 5 miniute breaks ie (4.00,4.05,4.10 etc)
column 2 = various times between 4am and 10.30pm
column 3 = various times between 4am and 10.30pm

what I want is to count how many times each cell in column 1 is between the
times in columns 2 and 3 and output the result into a cell, then by looping
repeat the same for the next cell in column 1

any ideas mucho appreciated...

just guessing here but something similar to below but without the bad syntax?

for each cell in range(a1,a231) count between range(c1,d781)
store result in cell g1
next count
store result in cell g2

etc



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default looping puzzle

D1:
=sumproduct(--(A1=$B$1:$B$200),--(A1<=$C$1:$C$200))

then drag fill down the column. change the 200 to refer to the extent of
the data. The fewer cells included, the faster this will recalculate.

--
Regards,
Tom Ogilvy


"Songoku" wrote:

Hi,

new to VB, just a quick one I have a worsheet that contains 3 columns

column 1 = 4am to 10.30pm in 5 miniute breaks ie (4.00,4.05,4.10 etc)
column 2 = various times between 4am and 10.30pm
column 3 = various times between 4am and 10.30pm

what I want is to count how many times each cell in column 1 is between the
times in columns 2 and 3 and output the result into a cell, then by looping
repeat the same for the next cell in column 1

any ideas mucho appreciated...

just guessing here but something similar to below but without the bad syntax?

for each cell in range(a1,a231) count between range(c1,d781)
store result in cell g1
next count
store result in cell g2

etc



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
A puzzle about updating. James Silverton[_3_] Excel Discussion (Misc queries) 3 February 5th 09 08:23 PM
vlookup puzzle lloyd Excel Worksheet Functions 3 December 6th 07 07:45 PM
Pivot Puzzle Wanna Learn Excel Discussion (Misc queries) 3 November 1st 07 12:11 AM
Can you help!!!!! New Puzzle Krefty Excel Discussion (Misc queries) 0 June 13th 05 08:13 PM
Randbetween puzzle??!? getexel Excel Programming 1 April 29th 04 06:30 PM


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