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!

:)





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:19 AM.

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"