Breaking Time Into Intervals And Performing A Count

Nov 20, 2006

Office 2003 with Windows XP

This is my first post so i may not have done everything correctly. I tried doing google searches to see if anyone else has done something similar but its a tricky thing to search for. I have found pages dealing with manipulating time but none seem to be what I want

I have an Excel sheet with data

A1=date
b1=source
C1-h1 all contain data (name, location, etc, etc) but I am not interested in those.

A1 (the date cell) is formatted like: m/d/yyyy" "h:mm:ss AM/PM

[Sample]

a2 = 8/1/2006 12:20:23 AM b2 = phone
a3 = 8/1/2006 12:21:13 AM b3 = email
a4 = 8/1/2006 12:33:03 AM b4 = phone

This is what I am trying to accomplish:
I want to break each hour, whether it contains data or not and get a count of the different types of source

my desired output would be:

time Phone email
12:00AM
to 2 3
12:30AM

My problem occurs because I am unsure how to break the times down into intervals. In my head, I would create a new column and try to break the time up into an interval. So for a2 (8/1/2006 12:20:23 AM), I think I would need to break the date and time up and then determine which interval would be needed based on the time.

I was going to perform the following:
=text(a2, "h" + if("mm:ss">30, 30,00)

Basically, pull the hour from a2 and evaluate the mins/secs.

If the min/sec is bigger than 30, put a 30 in the box. Less than 30, put double zero in the box. So for 8/1/2006 12:20:23 AM, b2 would have 12:00 since it falls in the 12 to 12:30 interval.

Once I have all the intervals, I would also need to preform a count on the source cell but I think I can use a vlookup to get the count for the interval.

Count Intervals Of 2 Numeric Values In Same Row And Return Count Across Row

Sep 23, 2005

I require a Formula to calculate the INTERVALS (the number of Rows between
the LAST instance and the PREVIOUS instance in a column) between each
individual occurrence of any designated PAIR of Numeric values (single-digit
/ double-digit) in the same Row of the Named Range "Results" and return each
calculated INTERVAL result to a separate Column on the same Row of a New
Sheet - starting with the most recent ( the LAST) occurrence.

For instance, each time 80 and 87 appear together in the same Row, return the
INTERVAL by calculating the number of Rows between the LAST instance and the
PREVIOUS instance in a column - locate when both Numeric values LAST appeared
together and Count back to their PREVIOUS appearance together to get the
required Count; i.e. count from the Row ABOVE LAST appearance to the Row
BEFORE PREVIOUS appearance.

The results are returned to a chart / matrix layout: I have the criterion
vertically and horizontally and they are referenced using the horizontal and
vertical cell address that houses each criterion, and the results are
returned across the Row of the intercept of the vertical and horizontal
criterion. At some point both criterion values being referenced will be the
same, can the Formula return empty text "" when this occurs?

Example Chart / Matrix Layout:
Cell Ref. A2 and B1 criterion 80 and 80
Cell Ref. A3 and B1 criterion 81 and 80
Cell Ref. A4 and B1 criterion 82 and 80

Criteria B1 houses 80
A2 houses 80
A3 houses 81
A4 houses 82
A5 houses 83

Performing A Specific Function Repeatedly But With Variable Values Each Time?

May 13, 2014

The spreadsheet has over 200K rows and two dozen columns. My job is to:

1. There are two columns, one is called OCR code where we have repeating ID's and other column is called Minutes Count which is basically a number. I have to filter the OCR column for similar OCR codes(values) and then add their time(Minute Count) so that I get total minutes for a specific OCR code. After adding the min I will copy them into a new sheet with the code in one column, total minutes in another and number of repeatitions for that specific OCR code or count number in a separate column. Example:

OCR_Code; Minutes
54xg; 456
45fk; 65
23IS; 18
54xg; 971
45fk; 265
.
.
.

Now I've to filter 54xg so that I can only see it and its corresponding minutes. Then I will add up all min for 54xg. Then I will count the number of instances a 54xg has been repeated in spreadsheet(here its 2 but it can be in hundreds in my case). Last thing is to transfer all this data to a new sheet. And automatically repeat the process for other OCR codes like 45fk, 23IS etc...

May 29, 2014

I have an excel table with over 130 sheets in it. The first 20 sheets I have a list of names(the sames names) to collect different types of information of them. From the sheet #21 until sheet#135(more or less) I have the person sheet (each sheets has their respective name) to collect even more information for each names from the list mentioned before from the first sheets. I already created hyperlinks on the first 20 sheets (sames names) that way from there I can go straight to the individual sheet. The problem is that every day I have to correct a few hyperlink because for some reason breaks. I got this error message "Reference not valid", therefore I have to edit the hyperlinlk and connect it again. Even if I save it, next day is another or the same one.

Any alternative way to create hyperlink besides click on Insert - Hyperlink - click on the name of the sheet? Could I do it using macros, visual basic or something and if I can, how to do it.

Getting A Macro To Run On Time Intervals

Dec 7, 2007

Below is the code i want to be run evey 2 minutes Thanks
Sub WebData()

Dim wSU As Worksheet
Dim wSR As Worksheet
Dim wSS As Worksheet

Dim iForRow As Integer
Dim iLastRow As Integer
Dim sURL As String

Sum Data For Time Intervals

Oct 10, 2009

I am trying to do is calculate (sum) results data for time intervals. For example, between 0500-0559hrs then 0600-0659hrs and so on. Data is collected at 1 minute intervals and may have a result of 0 or anywhere up to 30.

Column A has all time data e.g. 0500,0501,0502 etc
Column B has sum of instances e.g. 0,1,2,3 etc

Count Occurancies In Date Intervals

Apr 24, 2006

I have a workbook consisting of 4 columns where we log reported errors: Workbook1.xls DateNormalRelease Key Account Customer ID
Columns B and C have either a value of 1 or 0 at the date stated in A.
Column D is filled in only if the customer is a Key Account.

I also have a workbook where we manually inserts data from above workbook, amongst others; This workbook consists of 12 worksheets (one for each month)and includes these columns: Workbook2.xlsCustomer NameKey Account Customer ID Total Number of OrdersReported Errors. Is there a way to fetch all reported errors regarding a certain customer within a date interval and insert the value into column D?

Countifs Date And Time Intervals?

May 26, 2014

Count the number of occurences on 1 day within a 60 minute timeframe. data includes dates and times

Returning A Value If The Time Falls Between Two Intervals

Nov 7, 2009

I'm the Held desk manager . I'll have my folks logging in every time interval and work for 9hrs. Now I wanted to see at any given point a day the number of folks I have on my desk .

I have created table " A " and I'm looking for a formulae so that I get my data like table " B " .

To give more insight about table '" B " - During 00:00 - 00:30 , I'll have 41 people slowly goes down as people log off..

15 Min. Intervals To Incident Create Time

Jan 29, 2008

I need to compare how many incidents are created within a 15 min interval and populate the sum.

I currently have the create time of the incident in the format below, assume each date below is an incident. I have a column with 96 intervals (24hours) ie 8:00,8:15,8:30,8:45,9:00 etc.... Using a formula how can I say "if create time is between *:00 and *15 count 1 and put the number into the cell and do that for each interval?

A B
------|-------------------|
Int Incident
0 | 8:00 | 1/28/2008 8:32 AM
0 | 8:15 | 1/28/2008 8:35 AM
3 | 8:30 | 1/28/2008 8:41 AM
1 | 8:45 | 1/28/2008 8:46 AM

Run Multiple Macros At Different Set Time Intervals

Mar 27, 2008

The code from this page works perfectly when I am running one macro at a set interval: [url]

However, when I try to run multiple macros at different set intervals the order of execution gets messed up.

For example, I need macro1 to run at 00:00:30, macro2 at 00:00:45, macro3 at 00:01:00, then macro1 at 00:01:30, macro2 at 00:01:45, macro3 at 00:02:00 and so one.

Return Time Intervals Based On X Minutes

Feb 20, 2008

I have a spreadsheet set up that has a series of timestamps and values. Please find a copy attached. I need to set up a macro that will allocate the timestamp in column C to an interval of time, e.g between 12:30 - 13:00.

To achieve this I tried to set the following code up in VBA, which would input a letter in a blank cell based on the time interval that the timestampin column C falls into, for example if the timestamp is > 12:30 and < 13:00 then "A"...the plan was to extend this concept to accomodate all of possible the time intervals I have.

Sub time_intervals()

Dim x As Integer
Dim lastrow As Long
Dim timeA As Date
Dim timeB As Date
Dim timeC As Date
Dim timeD As Date
Dim timeE As Date

The idea was that the timemaster value would be the timestamp in column C of my spreadsheet and the timeA,timeB,timeC etc would reference the timeintervals. However this does not seem to work as the value returned by my if statement is always incorrect - for example timemaster in cell C2 is less than timeA but the if statement always returns FALSE as opposed to "A"

Continually Run Macro Code At Time Intervals

May 7, 2008

I am trying to continually refresh a spreadsheet (it is a countdown timer), and i am looking for a way to do this other than hold "F9". It is excel 97.

100 Rows Of Data With 2 Columns - Calculate In Time Intervals

Dec 14, 2011

I have 100 Rows of Data with 2 Columns.

The left contains data input and the right Columns contains certain formula.

How do I set it up so that the worksheet can eg. Calculate 5 rows and rest 1 Second and continue this way until it reached the end of the rows? (Number of rows is not fixed).

Line Chart Showing Values Over Time Intervals

Feb 18, 2007

I'm trying to do a line chart showing two teams and their cumulative scores over the period of a game. I've attached a sample with mock data. Is it possible to change the x-series of the charts to display custom time intervals like 0 min 1 min, 2 min, 3 min, 4 min, etc? Currently the x-series only has labels for each specific time there was a change in value. I've tried to change the scale but the options that I want aren't there.

Moving Average Of Real Time Data At Timed Intervals?

May 19, 2008

Currently i have a spreadsheet with realtime data feeds from Bloomberg (or reuters). What i would like to do is:

a. Fill a vector/column of data values every minute until we have 30 observations i.e. from 9.00am till 9.30pm

b. This will then allow me to calculate a moving average of the last 30 (1 minute) observations.

c. At 9.31am, the 9.00am value drops out of the column and is replaced by the observation at 9.31am. This results in a constantly updating column of the last 30 minute observations and will allow me to have a realtime moving average.

Count Number Of Times Specific Intervals Occur Between Relevant Values

May 5, 2008

I will say exactly what i want.

I want to keep statistics of roulette.

More specifically, i want to count how many times a dozen lates to come.

The range from 1-12 is 1st dozen, from 13-24 is the 2nd and 25-36 is the 3rd.

I want to count among these numbers, how many times one of three dozens appear every 1 time, how many times appears every 2 times, .... until 20 times.

For example: I have put in a column 500 numbers from 0 to 36.

The output must be like this:

1st Dozen: Every 1 time: x
Every 2 times: n
Every 20 times: m

The same for 2nd and 3rd dozen.

Count Function :: Vacation, Personal Time, & Sick Time

Nov 17, 2005

I am using the count function for attendance tracking of Vacation, Personal Time, & Sick Time. (Example: = COUNTIF(\$F6:\$CQ6, "V")

I need to be able to do half days. I have tried many different formulas/ways to incorporate the half day scenario even without using the count function with no success.

Count Number Of Full Time Periods Within A Time Period

Nov 18, 2008

I have thousands of timestamps that have a start & end date and time in 2 separate columns. (one named start and one named end...)

I also have numerous set time periods that i'm interested in.. (about a dozen or so)

for example 01/01/2008 - 05/01/2008, 07:30:00 - 10:00:00

What i need is to be able to count the number of times the full time period i am interested (07:30:00 - 10:00:00) in falls in between the thousands of start and end timestamps i have. The time periods must also fall within the date range specifed.

So if my timestamps were
Start: 01/01/2008 06:30:00 & End: 02/01/2008 11:00:00, based on the set time period above, there would be a count of 2

and if my timestamps were
Start: 01/01/2008 07:05:00 & End: 02/01/2008 09:00:00 there would be a count of zero as there is not a full uninterupted timeperiod 07:00:00 - 10:00:00 between these timestamps.

and if my timestamps were:
Start 01/01/2007 07:00:00 & End 02/01/2007 10:00:00 the count would be zer as this is a year early!

Looking Up 2 Conditions Before Performing Another Task?

Jul 12, 2013

I'm a fairly new user to using VBA and I'm currently running into a little snag. I'm trying tu create userform which will let me know if a person already exists in my sheet by looking up the last name in "A", then looking up his first name in "B", if such entry exists then display a message saying " Yes". If entry user has not been entered in the sheet then use a combox, to select the reason , then choose a date ( i have a working date picker ). Then entry should be entered in sheet (Name, Surname, Reason, date).

Whats working, I can use all of the above to enter all the info into the sheet, what I need to do is verify if user is alread in there, if not, then add it. The so on and so forth

Feb 26, 2008

i've managed to get a set of cells to show (with comments) what the last weeks data looked like. (so cell value = this week, comment contains last week)

What i now want to do is to use conditional formatting to highlight any major differences between the figures... so:

My comment i'm sure is stored as text in the format:

Previous value was
xxxxx

So the first thing i'd need to do is to to strip out the text at the start, and then perform the calculation.

Do While Loop Statement Not Performing

Aug 5, 2008

I have the following code which previously was showing an error on the Do While line. It was suggested that I change the line too Range("B2").Text. However, the loop is not deleting the rows based on "#N/A". Can anyone offer any suggestions?

Count Hours (time) Between Four Time Criteria

Aug 24, 2009

I am struggling to find a formula to calculate hour:minutes between the following:

Cell
A1= 04:00
B2= 17:00

I am wanting to calculate the hours between 06:00 and 16:00 and then the hours between 16:00 and 06:00 the next day

ie: 06:00-16:00 = 12;
16:00 - 0600 = 3

Data, Performing Functions, And Percentages?

Mar 13, 2009

I have a very large grid of data, about 400Rx200C, which contains a lot of blank fields. All of this data is currently in values from 0-100 representing percentages, but not formatted as such. I need to make all of these values into Excel Percentages so naturally used Paste Special and Divide from a field with the value 100 in it and then simply format the cells as %.

However, this fills in all of the original empty cells with a 0.000% which I do not want, I need them to stay blank. And some of the cells that do have values also have 0.000% so I cannot just delete all of these values with a VBA script. I had been hoping the Skip Blanks option would do this, but it does not unfortunately.

Opening Files While Performing Vlookup

Sep 22, 2009

I am trying to write a Macro that will do the following.

1. Using a new workbook
2. Open a file in a in a directory. Then
3. Run a vlookup using the opened file as the filename in the vlookup
4. Paste the results of the vlookup into the original file next to the file name.
5. Close the file and open the next one in the folder.

The folder contains about 2k files that it needs to loop through. I found a macro on this site created by Ravishankar and attempted to add to it. Not going so well.

Subroutine Stops Before Performing All Commands?

Jun 17, 2013

I have two subroutines. One subroutine updates some figures on spreadsheet 1, and then calls a subroutine that updates some figures on spreadsheet 2. Spreadsheet 2 is supposed to save and close, and return to spreadsheet 1, but it only gets as far as opening spreadsheet 2 and updating the figures. These are the two subroutines:

Code:
Sub UpdateLegalAndMeans()
Dim wBook As Workbook
Dim count As Integer ' counter for counting down backlog figures

[Code]....

Setting Range Of Numbers And Performing Subtraction?

Mar 28, 2014

I am creating a range of numbers from 1 to 2000 with increments of 0.5. Then I have to subtract certain range, for example, 100 to 350. So, the result should display, 1 to 95.5 and 350.5 to 2000.

Assigning Value By Performing Search Relative To Position

Jan 19, 2012

The data is a copy of CSV file in to a spreadsheet. Below is what the paste looks like:

100100 Books
1234.ab
1345.bf
1456
1567
100100 Books
100200 Magazines
100300 Videos
1234.ab
1345.bf
1456
1567
100300 Videos

All of the numbers between the 100100 Books, 100300 Videos belongs to that category. This repeats hundreds of rows down. I need the column to the left of this range to display which division it under. I parse this in excel so Books, Videos, Magazines will be in their own column. I am not exporting the CSV so have to manipulate it in excel. I need to have the column to the left combine the whole identifier so I can perform a VLOOKUP on it. It should look as follows:

100100.1234.ab
100100.1345.bf
etc.

My approach was to get the column to the left of the range to display the correct division, then have another column combine by using (cell)&"."&(cell).

Formula Stops Working After Performing Certain Tasks

Nov 21, 2006

I was given the following formula by Domenic some time ago that I use along with VBA code supplied by Fin Fan Foom to open do a lookup on a closed workbook:

=If(ISNUMBER(MATCH(MIN(If( Date=D2,If(ABS(Time-E2)<"0:30:30"+0,ABS(Time-E2)))),If(Date=D2,ABS(Time-E2)),0)),INDEX(Contact,MATCH(MIN(If(Date=D2,If(ABS(Time-E2)<"0:30:30"+0,ABS(Time-E2)))),If(Date=D2,ABS(Time-E2)),0)),"")
Everything works fine, until I attempt to…
- cut & paste a block of cells, or
- do a SaveAs, or
- change a worksheet name

The formula will no longer function after performing any of these tasks (the cells go blank), and I have to close the workbook without saving to preserve the original workbook functionality. All other tasks, including even importing of different files into the workbook have NO negative effect.

The formula uses an “INDIRECT” named range. Sheet name changes are reflected in the named ranges, but any change of names somehow causes a malfunction (no sheet names are referenced in the VBA).

I thought that the large lookup workbook (40,000 rows) may be a problem, but even after deleting most of the data and retaining only a few rows, the problem still remained.

After the formula cuts out (after performing the above tasks), if I open up the lookup file, then the lookup will work again, but if I close the lookup file, it will stop working.

I doubt the problem is in the VBA code since IT WORKS, and besides, I have other simple VLookups formulas that also uses the same process (and VBA code) and they continue to work just fine when that one formula gives out. The only thing I can think of is that the complexity of that one formula may be an issue.

Anyway, I the original thread is long, so I’m starting a new one here. The original thread is here (Domenic’s formula, pg 7; FFF’s code, pg 8):
Dedicated Cell To Choose Lookup Table

Performing Worksheet Functions On One Column Of A Two Dimensional Array?

Nov 19, 2009

I have an array with dimensions (5000,30). I want to perform a worksheet function "Percentile" on specific columns within the array. So for instance I may want to know the element falling at the 50th percentile in column 5 of the 30 column array. Is there a way to do this without having to place the array onto a worksheet?