Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Count number of occurences within a time range

Hi

Hope someone can help me out.

I have a daily spreadsheet of log files that have been generated from a
database and exported to Excel. In preparation for graphing them, I
would like to be able to summarise the number of incidents that were
logged each hour. The format of the spreadsheet is as follows:

A B C D
1 DATE, TIME, MESSAGE, IP ADDRESS
2 07/09/06 00:01:34 <DATA 10.0.0.0
3 07/09/06 02:04:41 <DATA 10.0.0.0
4 07/09/06 06:17:20 <DATA 10.0.0.0

The 'Time' column is formatted to hours/minutes/seconds.

I have been experimenting with COUNTIF and SUMPRODUCT functions, but
haven't managed to come up with anything that gives me what I need. I'd
like to have a formula I can use to create 24 totals (one for each
hour), which I can then use in a graph to show system activity.

Has anyone got any ideas or can point me in the right direction for a
function to do this?

Thanks, in advance!

:)

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,688
Default Count number of occurences within a time range

Hi!

How do you want to breakout the time intervals:

12:00:00 AM to 1:00:00 AM

12:00:00 AM to 12:59:59 AM

Try this and just play with the time interval:

To count from 12:00:00 AM to 1:00:00 AM (inclusive):

=COUNTIF(B2:B4,"="&TIME(0,0,0))-COUNTIF(B2:B4,""&TIME(1,0,0))

Biff

wrote in message
oups.com...
Hi

Hope someone can help me out.

I have a daily spreadsheet of log files that have been generated from a
database and exported to Excel. In preparation for graphing them, I
would like to be able to summarise the number of incidents that were
logged each hour. The format of the spreadsheet is as follows:

A B C D
1 DATE, TIME, MESSAGE, IP ADDRESS
2 07/09/06 00:01:34 <DATA 10.0.0.0
3 07/09/06 02:04:41 <DATA 10.0.0.0
4 07/09/06 06:17:20 <DATA 10.0.0.0

The 'Time' column is formatted to hours/minutes/seconds.

I have been experimenting with COUNTIF and SUMPRODUCT functions, but
haven't managed to come up with anything that gives me what I need. I'd
like to have a formula I can use to create 24 totals (one for each
hour), which I can then use in a graph to show system activity.

Has anyone got any ideas or can point me in the right direction for a
function to do this?

Thanks, in advance!

:)



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Count number of occurences within a time range

Cheers Biff

Actually, I've figured out the formula I need.

=SUMPRODUCT(--($B$1:$B$166=(0/24)),--($B$1:$B$166<=(1/24)))

It works like a charm

Now all I need to do is work out how to suppress zero values from
appearing (I'd like to enter the range as B1:B50000 (each date in the
spreadsheet has a differing number of logs) but when I do this, the
results are obviously skewed for the first hour, as zero values are
counted. At present I've botched my way around this by amending the
formula to read:

=SUMPRODUCT(--($B$1:$B$50000=(0.00001/24)),--($B$1:$B$50000<=(1/24)))

which works - but isn't exactly elegant!

Thanks for the advice though

Zeb

Biff wrote:
Hi!

How do you want to breakout the time intervals:

12:00:00 AM to 1:00:00 AM

12:00:00 AM to 12:59:59 AM

Try this and just play with the time interval:

To count from 12:00:00 AM to 1:00:00 AM (inclusive):

=COUNTIF(B2:B4,"="&TIME(0,0,0))-COUNTIF(B2:B4,""&TIME(1,0,0))

Biff

wrote in message
oups.com...
Hi

Hope someone can help me out.

I have a daily spreadsheet of log files that have been generated from a
database and exported to Excel. In preparation for graphing them, I
would like to be able to summarise the number of incidents that were
logged each hour. The format of the spreadsheet is as follows:

A B C D
1 DATE, TIME, MESSAGE, IP ADDRESS
2 07/09/06 00:01:34 <DATA 10.0.0.0
3 07/09/06 02:04:41 <DATA 10.0.0.0
4 07/09/06 06:17:20 <DATA 10.0.0.0

The 'Time' column is formatted to hours/minutes/seconds.

I have been experimenting with COUNTIF and SUMPRODUCT functions, but
haven't managed to come up with anything that gives me what I need. I'd
like to have a formula I can use to create 24 totals (one for each
hour), which I can then use in a graph to show system activity.

Has anyone got any ideas or can point me in the right direction for a
function to do this?

Thanks, in advance!

:)


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,688
Default Count number of occurences within a time range

It works like a charm
Now all I need to do is work out how to suppress zero values


Then it must not work like a charm!

Sumproduct will evaluate empty cells as 0 which is why I suggested using
Countif. Countif is also more efficient.

You can add another array to Sumproduct that tests for empty cells:

=SUMPRODUCT(--(ISNUMBER($B$1:$B$166)),--($B$1:$B$166=0),--($B$1:$B$166<=1/24))

Biff

wrote in message
ups.com...
Cheers Biff

Actually, I've figured out the formula I need.

=SUMPRODUCT(--($B$1:$B$166=(0/24)),--($B$1:$B$166<=(1/24)))

It works like a charm

Now all I need to do is work out how to suppress zero values from
appearing (I'd like to enter the range as B1:B50000 (each date in the
spreadsheet has a differing number of logs) but when I do this, the
results are obviously skewed for the first hour, as zero values are
counted. At present I've botched my way around this by amending the
formula to read:

=SUMPRODUCT(--($B$1:$B$50000=(0.00001/24)),--($B$1:$B$50000<=(1/24)))

which works - but isn't exactly elegant!

Thanks for the advice though

Zeb

Biff wrote:
Hi!

How do you want to breakout the time intervals:

12:00:00 AM to 1:00:00 AM

12:00:00 AM to 12:59:59 AM

Try this and just play with the time interval:

To count from 12:00:00 AM to 1:00:00 AM (inclusive):

=COUNTIF(B2:B4,"="&TIME(0,0,0))-COUNTIF(B2:B4,""&TIME(1,0,0))

Biff

wrote in message
oups.com...
Hi

Hope someone can help me out.

I have a daily spreadsheet of log files that have been generated from a
database and exported to Excel. In preparation for graphing them, I
would like to be able to summarise the number of incidents that were
logged each hour. The format of the spreadsheet is as follows:

A B C D
1 DATE, TIME, MESSAGE, IP ADDRESS
2 07/09/06 00:01:34 <DATA 10.0.0.0
3 07/09/06 02:04:41 <DATA 10.0.0.0
4 07/09/06 06:17:20 <DATA 10.0.0.0

The 'Time' column is formatted to hours/minutes/seconds.

I have been experimenting with COUNTIF and SUMPRODUCT functions, but
haven't managed to come up with anything that gives me what I need. I'd
like to have a formula I can use to create 24 totals (one for each
hour), which I can then use in a graph to show system activity.

Has anyone got any ideas or can point me in the right direction for a
function to do this?

Thanks, in advance!

:)




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Count number of occurences within a time range

Ohhhh Biff - you're a star.

THAT works like a charm!

:)

Thanks a lot

Zeb


Biff wrote:
It works like a charm
Now all I need to do is work out how to suppress zero values


Then it must not work like a charm!

Sumproduct will evaluate empty cells as 0 which is why I suggested using
Countif. Countif is also more efficient.

You can add another array to Sumproduct that tests for empty cells:

=SUMPRODUCT(--(ISNUMBER($B$1:$B$166)),--($B$1:$B$166=0),--($B$1:$B$166<=1/24))

Biff

wrote in message
ups.com...
Cheers Biff

Actually, I've figured out the formula I need.

=SUMPRODUCT(--($B$1:$B$166=(0/24)),--($B$1:$B$166<=(1/24)))

It works like a charm

Now all I need to do is work out how to suppress zero values from
appearing (I'd like to enter the range as B1:B50000 (each date in the
spreadsheet has a differing number of logs) but when I do this, the
results are obviously skewed for the first hour, as zero values are
counted. At present I've botched my way around this by amending the
formula to read:

=SUMPRODUCT(--($B$1:$B$50000=(0.00001/24)),--($B$1:$B$50000<=(1/24)))

which works - but isn't exactly elegant!

Thanks for the advice though

Zeb

Biff wrote:
Hi!

How do you want to breakout the time intervals:

12:00:00 AM to 1:00:00 AM

12:00:00 AM to 12:59:59 AM

Try this and just play with the time interval:

To count from 12:00:00 AM to 1:00:00 AM (inclusive):

=COUNTIF(B2:B4,"="&TIME(0,0,0))-COUNTIF(B2:B4,""&TIME(1,0,0))

Biff

wrote in message
oups.com...
Hi

Hope someone can help me out.

I have a daily spreadsheet of log files that have been generated from a
database and exported to Excel. In preparation for graphing them, I
would like to be able to summarise the number of incidents that were
logged each hour. The format of the spreadsheet is as follows:

A B C D
1 DATE, TIME, MESSAGE, IP ADDRESS
2 07/09/06 00:01:34 <DATA 10.0.0.0
3 07/09/06 02:04:41 <DATA 10.0.0.0
4 07/09/06 06:17:20 <DATA 10.0.0.0

The 'Time' column is formatted to hours/minutes/seconds.

I have been experimenting with COUNTIF and SUMPRODUCT functions, but
haven't managed to come up with anything that gives me what I need. I'd
like to have a formula I can use to create 24 totals (one for each
hour), which I can then use in a graph to show system activity.

Has anyone got any ideas or can point me in the right direction for a
function to do this?

Thanks, in advance!

:)





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,688
Default Count number of occurences within a time range

You're welcome!

Biff

wrote in message
ups.com...
Ohhhh Biff - you're a star.

THAT works like a charm!

:)

Thanks a lot

Zeb


Biff wrote:
It works like a charm
Now all I need to do is work out how to suppress zero values


Then it must not work like a charm!

Sumproduct will evaluate empty cells as 0 which is why I suggested using
Countif. Countif is also more efficient.

You can add another array to Sumproduct that tests for empty cells:

=SUMPRODUCT(--(ISNUMBER($B$1:$B$166)),--($B$1:$B$166=0),--($B$1:$B$166<=1/24))

Biff

wrote in message
ups.com...
Cheers Biff

Actually, I've figured out the formula I need.

=SUMPRODUCT(--($B$1:$B$166=(0/24)),--($B$1:$B$166<=(1/24)))

It works like a charm

Now all I need to do is work out how to suppress zero values from
appearing (I'd like to enter the range as B1:B50000 (each date in the
spreadsheet has a differing number of logs) but when I do this, the
results are obviously skewed for the first hour, as zero values are
counted. At present I've botched my way around this by amending the
formula to read:

=SUMPRODUCT(--($B$1:$B$50000=(0.00001/24)),--($B$1:$B$50000<=(1/24)))

which works - but isn't exactly elegant!

Thanks for the advice though

Zeb

Biff wrote:
Hi!

How do you want to breakout the time intervals:

12:00:00 AM to 1:00:00 AM

12:00:00 AM to 12:59:59 AM

Try this and just play with the time interval:

To count from 12:00:00 AM to 1:00:00 AM (inclusive):

=COUNTIF(B2:B4,"="&TIME(0,0,0))-COUNTIF(B2:B4,""&TIME(1,0,0))

Biff

wrote in message
oups.com...
Hi

Hope someone can help me out.

I have a daily spreadsheet of log files that have been generated
from a
database and exported to Excel. In preparation for graphing them, I
would like to be able to summarise the number of incidents that were
logged each hour. The format of the spreadsheet is as follows:

A B C D
1 DATE, TIME, MESSAGE, IP ADDRESS
2 07/09/06 00:01:34 <DATA 10.0.0.0
3 07/09/06 02:04:41 <DATA 10.0.0.0
4 07/09/06 06:17:20 <DATA 10.0.0.0

The 'Time' column is formatted to hours/minutes/seconds.

I have been experimenting with COUNTIF and SUMPRODUCT functions, but
haven't managed to come up with anything that gives me what I need.
I'd
like to have a formula I can use to create 24 totals (one for each
hour), which I can then use in a graph to show system activity.

Has anyone got any ideas or can point me in the right direction for
a
function to do this?

Thanks, in advance!

:)





  #7   Report Post  
Junior Member
 
Posts: 3
Question

Hi Biff,
I've been trying to figure out solving my problem particularly in this topic but unsuccessful. Could you or anyone who is reading this message help me? I'm working on a report/analysis that displays many crucial data. Out of these data, I'll narrow down to the important part that is (i) Name column, (ii) Date column and (iii) Time stamp (refer to attachment). My records are formatted according to the attached sample file. I'm trying to analyse these data to identify count of instances for each individual, hourly e.g.
(i) 9:00 a.m. to 9:59 a.m. represented by 9AM-10AM
(ii) 10:00 a.m. to 10:59 a.m. represented by 10AM-11AM
(iii) 11:00 a.m. to 11:59 a.m. represented by 11AM-12PM

I've tried using COUNTIFS formula but the results keep displaying "-" symbol. Please help. Thanks.

Regards,
B30K
Attached Files
File Type: zip Sample.zip (7.1 KB, 44 views)
  #8   Report Post  
Member
 
Posts: 93
Default

Hi B30K

You should really start your own thread!

I have put proper times in the cells above your table, see the attached, you can hide these if required. Then using the COUNTIFS in G3: =COUNTIFS($B$2:$B$11,$F3,$D$2:$D$11,"="&F$1,$D$2: $D$11,"<="&G$1) Copy across and down.
Just another note, I have changed the dates in column C to proper dates, they are easier to work with, the same as proper times.

Kevin






Quote:
Originally Posted by B30K View Post
Hi Biff,
I've been trying to figure out solving my problem particularly in this topic but unsuccessful. Could you or anyone who is reading this message help me? I'm working on a report/analysis that displays many crucial data. Out of these data, I'll narrow down to the important part that is (i) Name column, (ii) Date column and (iii) Time stamp (refer to attachment). My records are formatted according to the attached sample file. I'm trying to analyse these data to identify count of instances for each individual, hourly e.g.
(i) 9:00 a.m. to 9:59 a.m. represented by 9AM-10AM
(ii) 10:00 a.m. to 10:59 a.m. represented by 10AM-11AM
(iii) 11:00 a.m. to 11:59 a.m. represented by 11AM-12PM

I've tried using COUNTIFS formula but the results keep displaying "-" symbol. Please help. Thanks.

Regards,
B30K
Attached Files
File Type: zip 002-Sample.zip (10.0 KB, 63 views)
  #9   Report Post  
Junior Member
 
Posts: 3
Thumbs up

Hi Kevin,
Sweet.....you got the code cracked.
I've applied it into my worksheet at it's working as expected.
Thank you so much.

Regards,
B30k
  #10   Report Post  
Member
 
Posts: 93
Default

No problem, glad I was able to help.

Quote:
Originally Posted by B30K View Post
Hi Kevin,
Sweet.....you got the code cracked.
I've applied it into my worksheet at it's working as expected.
Thank you so much.

Regards,
B30k
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
Edit Macro 1st time use sparx Excel Discussion (Misc queries) 1 March 12th 06 04:04 PM
count number of occurances of a word in a range John Davies Excel Worksheet Functions 3 February 24th 06 01:46 PM
Using Countif to count occurences of time? Liketoknow Excel Worksheet Functions 5 February 6th 06 08:21 AM
Count number of occurences in 1 column only if something in anothe Wenster Excel Worksheet Functions 2 February 7th 05 09:58 PM
count number of occurences within a string Gabriel Excel Worksheet Functions 2 November 25th 04 04:17 PM


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