Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default need help with 'counting' between values

Good afternoon,

I believe I have a simple task at hand, I just cannot come up with a way to
programmatically achieve the desired results. I have a column that has time
values displayed. I need to count (and display in cell c118) all of those
times that are between 8:00 and 8:59. Then count (and display in cell c119)
all of those times that are between 9:00 and 10:00; and so on, until probably
20:00.

I am a rookie, so I failed at trying to use an array to accomplish. I ended
up with 10 'For' loops, and even then it still didn't work the way it was
supposed to . Any and all assistance would be greatly appreciated. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default need help with 'counting' between values

In A118 enter 08:00
In B118 enter 09:00
in C118 enter =SUMPRODUCT(--(M1:M100-A118),--(M1:M100<B118))

etc.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Johnny Mick" wrote in message
...
Good afternoon,

I believe I have a simple task at hand, I just cannot come up with a way

to
programmatically achieve the desired results. I have a column that has

time
values displayed. I need to count (and display in cell c118) all of those
times that are between 8:00 and 8:59. Then count (and display in cell

c119)
all of those times that are between 9:00 and 10:00; and so on, until

probably
20:00.

I am a rookie, so I failed at trying to use an array to accomplish. I

ended
up with 10 'For' loops, and even then it still didn't work the way it was
supposed to . Any and all assistance would be greatly appreciated.

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default need help with 'counting' between values

Mr. Phillips,
Please excuse my ignorance. I wasn't quite sure how to word the question.
The example you provided works very well for the 'question' I posed; what I
was really trying to do though, was 'count' the line item that has a time
between 8:00 and 9:00; and so on. So instead totaling the times listed in
the column, I was looking more for something like a 'countif' type scenario.
I just can't figure out how to set it up as an array/loop. I am an amateur
at best, when it comes to writing macros, so my solution was to write a 'for
loop and count the time slot (8:00-9:00, etc.. . ), so that I didn't have to
write one for each time slot' Anyway. Thank you very much for the speedy
response. Stumbling onto this link has been a godsend.

"Bob Phillips" wrote:

In A118 enter 08:00
In B118 enter 09:00
in C118 enter =SUMPRODUCT(--(M1:M100-A118),--(M1:M100<B118))

etc.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Johnny Mick" wrote in message
...
Good afternoon,

I believe I have a simple task at hand, I just cannot come up with a way

to
programmatically achieve the desired results. I have a column that has

time
values displayed. I need to count (and display in cell c118) all of those
times that are between 8:00 and 8:59. Then count (and display in cell

c119)
all of those times that are between 9:00 and 10:00; and so on, until

probably
20:00.

I am a rookie, so I failed at trying to use an array to accomplish. I

ended
up with 10 'For' loops, and even then it still didn't work the way it was
supposed to . Any and all assistance would be greatly appreciated.

Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default need help with 'counting' between values

Johnny,

That is a countif scenario, count if times after 7:59 and before 9:00.

Give a data example and expected results.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Johnny Mick" wrote in message
...
Mr. Phillips,
Please excuse my ignorance. I wasn't quite sure how to word the question.
The example you provided works very well for the 'question' I posed; what

I
was really trying to do though, was 'count' the line item that has a time
between 8:00 and 9:00; and so on. So instead totaling the times listed in
the column, I was looking more for something like a 'countif' type

scenario.
I just can't figure out how to set it up as an array/loop. I am an

amateur
at best, when it comes to writing macros, so my solution was to write a

'for
loop and count the time slot (8:00-9:00, etc.. . ), so that I didn't have

to
write one for each time slot' Anyway. Thank you very much for the speedy
response. Stumbling onto this link has been a godsend.

"Bob Phillips" wrote:

In A118 enter 08:00
In B118 enter 09:00
in C118 enter =SUMPRODUCT(--(M1:M100-A118),--(M1:M100<B118))

etc.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Johnny Mick" wrote in message
...
Good afternoon,

I believe I have a simple task at hand, I just cannot come up with a

way
to
programmatically achieve the desired results. I have a column that

has
time
values displayed. I need to count (and display in cell c118) all of

those
times that are between 8:00 and 8:59. Then count (and display in cell

c119)
all of those times that are between 9:00 and 10:00; and so on, until

probably
20:00.

I am a rookie, so I failed at trying to use an array to accomplish. I

ended
up with 10 'For' loops, and even then it still didn't work the way it

was
supposed to . Any and all assistance would be greatly 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
Counting values in one cell based on values in another S2 Excel Discussion (Misc queries) 7 April 18th 09 02:46 AM
counting rows with same values for multiple values Jon Viehe New Users to Excel 4 September 1st 05 03:49 PM
Counting rows, then counting values. Michael via OfficeKB.com Excel Discussion (Misc queries) 7 August 4th 05 10:57 PM
Counting Rows Then Counting Values in Columns Michael via OfficeKB.com Excel Programming 1 June 1st 05 04:10 PM
Counting values Adam1 Chicago Excel Worksheet Functions 9 December 21st 04 03:36 PM


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