Insert & Fill Missing Rows Within Sequential Dates & Times List
Sep 17, 2009
I have tried many different ways of coming up with a solution of this problem without writing a VBA program, however, Excel's date and time formatting scheme seem to be tripping me up. As a result, I am trying to figure out what direction to go.
I have seached the board up and down looking for a solution and I have found one problem that is midly similar but I do not fully understand the code. I have tried to modify it but to no avail.
Here is my problem:
I have 9 columns of data that are reported in 15 minute intervals for a little over 3 years. There are missing data in the data set and it would be infeasable for me to manually find and replace the missing data. (Over 110000 rows of data)
Example of data (Where "/" delienates column seperation):
Date / Temp 2m / Temp 10 m / Radiation / RH / WindAve / WindMax / WindMin / Rain
6-1-06 12:15 am / 45 / 35 / .0001 / 95 / 5 / 7 / 3 / 0
6-1-06 12:30 am / 45 / 35 / .0001 / 95 / 5 / 7 / 3 / 0
6-1-06 12:45 am / 45 / 35 / .0001/ 95 / 5 / 7 / 3 / 0
6-2-06 6:00 pm / 45 / 35 / .0001 / 95 / 5 / 7 / 3 / 0
6-2-06 6:15 pm / 45 / 35 / .0001 / 95 / 5 / 7 / 3 / 0
So what I need to do is this:
1) Find which data times are missing
2) Add the appropriate amount of rows in between where the missing data would be
3) Add the correct dates to the new rows
4) Add "N/A" to the columns that have no data
You can see that my date and time are formatted in mm/dd/yy hh:mm
I found this on the website and was trying to modify it to my needs:
Sub InsRow()
Dim c
View 9 Replies
ADVERTISEMENT
Feb 19, 2008
The excel file has industrial information arranged by sector. The sectors are represented by six digit codes that are not strictly sequential. For example, a typical example of consecutive codes is 120011,120012,120030,120040,130011. There are upwards of three hundred sectors.
The data I am using is missing certain sectors - sometimes more than 30 at a time. I would like to find a quick way to identify the missing sectors and insert rows there, preferably with the first cell in the row being the missing sectoral code.
I have a similar problems with columns as well. But I can always just transpose the data and use whatever solution works for the rows.
View 9 Replies
View Related
Apr 28, 2014
I have data in several rows whereby my column D looks like this:
FebtReport14_01.0000
FebtReport14_02.0000
FebtReport14_03.0000
FebtReport14_04.0000
FebtReport14_05.0000
Throughout the week, additional data is added to the rows, thus creating blank cells within this D Column:
FebtReport14_01.0000
FebtReport14_02.0000
FebtReport14_03.0000
FebtReport14_04.0000
FebtReport14_05.0000
Is there a macro i can run which will re increment only the blank cells to look something like this?"
FebtReport14_01.0000
FebtReport14_02.0000
FebtReport14_03.0000
FebtReport14_03.1000
FebtReport14_04.0000
FebtReport14_04.1000
FebtReport14_04.2000
FebtReport14_04.3000
FebtReport14_05.0000
Also , I will be adding new data quite often, in which newer rows may need to be added in between: ie:
from this
FebtReport14_04.0000
FebtReport14_04.1000
to something like this:
FebtReport14_04.0000
FebtReport14_04.0100
FebtReport14_04.0200
FebtReport14_04.1000
View 5 Replies
View Related
Nov 27, 2007
I have a sequence(or a series is more proper) of dates(without the hours) for. exapmple: 10/22/2007,1025/2007,10/25/2007. What I need is to insert rows with the missing dates. I found a VBE code for a macro which does the work but now the problem is that in some rows the dates are the same and if I have two times 10/25/2007 it adds the row with the next date after the first one and all messes up.
Range("A2").Select
Do Until ActiveCell.Value = Empty
If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value + 1 Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.EntireRow.Insert
ActiveCell.Value = ActiveCell.Offset(-1, 0).Value + 1
ActiveCell.Offset(1, 0).Select
End If
Loop
View 9 Replies
View Related
Dec 10, 2008
I am busy with a very large dataset +-20 000 records showing the movement data
and I am having problem with inserting missing data: I have columns titled day hour and position, but multiple records for each as data was initally recorded by second. Data looks like this
Day Hour Position
1 2 Z5
1 2 Z5
1 3 Z5
1 3 Z4
1 16 Z1
12 2 Z3
13 0 Z3
What I need to end up with is a sequential dataset running from day 1 to 388 with hours 1-24 of each day. Positions need to be filled in for all data recorded (see above). The big problem is that movements between positions need to be recorded and accounted for i.e if more than >80 of time was spent at the position Z3 then that is the position for the hour.
View 9 Replies
View Related
Feb 12, 2014
how to leaved blank cells for missing dates in a series of sequential dates. For example, If my series is (in (m/d/y) format):
1/10/1999
1/12/1999
1/13/1999
1/14/1999
1/17/1999
1/18/1999
But I want it to be:
1/10/1999
(blank cell)
1/12/1999
1/13/1999
1/14/1999
(blank cell)
(blank cell)
1/17/1999
1/18/1999
How do I do this?
View 1 Replies
View Related
Aug 9, 2008
i have a time series of data at one hour interval ( from 6:00 hrs to 18:00 hrs ) each day and again from 6:00 to 18:00 hrs next day and so on for several years. in this series many data are missing. i ve to fill in these missing data in such a manner so that the new values becomes the linearly interpolated values in between the data given at any two hours. no rows are allowed to be inserted in between 18:00 hrs of the previous day to 6:00 hrs on the next day. pl see the attatchment.
View 2 Replies
View Related
Aug 4, 2009
I am looking for help. Sheet1 B1:1 has dates in each column in ascending order for one month. There are missing dates in between the days and they might look like this.
Example 1
7/1/20097/2/20097/6/20097/7/2009
Is there a code that will insert columns with the missing dates between the dates that already exist so that example 1 would become example 2?
Example 2
7/1/20097/2/20097/3/20097/4/20097/5/20097/6/20097/7/2009
View 6 Replies
View Related
Jan 22, 2014
I have a tracking template with a column listing dates, all i want to do is find all the missing dates from that column of dates.
Example:
Column A
1-May
2-May
4-May
5-May
7-May
8-May
10-May
11-May
12-May
14-May
15-May
I want to list the missing dates from this list.
View 4 Replies
View Related
Dec 19, 2011
We recently bought some new software at work, and I'm having trouble formatting the exported data in a way that will work with existing reports. The attached file is what the data looks like after being exported. Basically, what I'm trying to do is insert rows for the missing numbers -- i.e., each name should be followed by rows numbered 1 through 10.
John Smith John Smith
1 1
4 2
8 3
4
5
6
7
8
9
10
My ultimate end goal is to have columns of data for each name, instead of rows:
John Smith 1 2 3 4 5 6 7 8 9 10
I've created a formula that can do that part, but it operates on the assumption that each name will be followed by a set number of rows.
What little I know about vba I've learned on my own, so I may just be missing something obvious.
View 4 Replies
View Related
Jun 18, 2008
can do the following thing:
Here's a simplified form of my data under the two columns B and C
B C
1 a
2 b
5 c
7 d
I want dummy rows to be inserted for the missing rows like:
B C
1 a
2 b
3 dummy
4 dummy
5 c
6 dummy
7 d
View 2 Replies
View Related
Jun 17, 2007
I have a sheet with a date and the number of months on it which will change. I need the sheet to list the dates in a column for each month automatically: e.g. Two cells contain date “jan07” and the period “10” months. The rows A1 to A10 should have jan07…jan16 listed automatically. If I change then change the number of month to 11 I would like the rows A1 to A11 to update automatically.
View 6 Replies
View Related
Apr 25, 2014
I am processing an infinite set of data from a meteorological station here in Alaska which gives me half hourly data reading with a time stamp 00.00, 00.30, 01.00, 01.30, 02.00, 02.30 and so on.
I am using this formula to detect every time half hour reading is skipped (=IF(TEXT(MOD(B1936-B1934,1),"[M]")="30","","missing")) and it works pretty well.
Still I have to check and manually insert extra missing for every half hour missing but that's bearable.
This formula inserts a "missing" every time it finds a gap.
My question is: How can I insert a row above every cell with "missing"?
How do I do that? Here is also my excel sheet.
CR1000_Meteo_20131113_2_CLEANED.xls
View 3 Replies
View Related
Apr 17, 2013
I have a sheet where one column has sequencial numbers from lowest to highest with some missing. So for example: A1 1, A2 3, A3 5, A4 6. Is there a formula that will display all the numbers that are missing from this column without skipping rows? So let's say: B1 2, B2 4 ect.
Basically I will be putting this on a different tab, so someone can go to that tab and see what numbers have not been used. It is a large range and is difficult for someone to scan through it all.
View 8 Replies
View Related
Jul 8, 2008
I have two columns which i want to compare, they contain text data such as A123.
what I'd like is if its in column A and not in Column B then add to bottom of column A.
Once its in column A i can do the vlookup's to draw the other data, costs etc, over but don't know how to identify, and add, the missing codes to the list.
View 9 Replies
View Related
Apr 1, 2009
I need help deleting rows which contain a cell with date / time in the format dd/mm/yyyy hh:mm if the value is older than the current date / time
any ideas?
View 6 Replies
View Related
Jul 20, 2014
I'm making a Purchase Order generator for work. Essentially, the main screen has buttons and the user selects the company, job number, their name etc. They click 'Generate' and it will great a brand new excel file for them with all the correct codes, ready to populate and send to a client. In the main sheet, we also have a master list showing every purchase order made to date. This is where I am currently stuck. I will have many more questions on the way. This is my first program so very new!
Lets say we have the following in cells A1 and A2. The rest is blank:
REQ0001
REQ0002
[Code] .......
View 3 Replies
View Related
Apr 8, 2014
I am trying to insert formulas to my cells in different columns and then fill down the formulas as many rows as in the reference column. So far I have put my formulas in a macro but I seem to get problems with " and ' symbols. My macro looks like this:
Sheets("Sold Articles Database").Select
Range("U3").Formula = " =VLOOKUP(LEFT(K3,2),'Input Variables'!$A$48:$B$52,2,FALSE)"
Range("V3").Formula = " =VLOOKUP(K3,'Product datas'!$A$2:$C$10000,3,FALSE)"
Range("W3").Formula = " =VLOOKUP(K3,'Product datas'!$A$2:$D$10000,4,FALSE)"
[Code] ........
View 3 Replies
View Related
Dec 21, 2012
I am trying to set up excel sheets for documents that we print often. I would like to print them with page numbers in right footer that increases sequentially.
setting up a macro. But very time I print it starts from same number instead of the number after where I left off. Example: if I print today with page numbers 1 through 12, next time I want it to print number 13 through whatever no of copies printed.
Here is the code I copied from one of the threads here:
[Code] .....
I need the page number in right footer and also the macro to save the last number printed.
View 3 Replies
View Related
May 28, 2009
I'm running a macro that opens another workbook and read data from it.How can I incorporate this code into my macro.Sorry i don't knwo VBA.
Workbooks.Open Filename:="C:Documents and SettingsmsimantbDesktopINFRACHEM_POLYMERS - DON''T DELETE.xls]Sheet1"
UserGRP_MAcro Macro
Rows("1:3").Select
Selection.Delete Shift:=xlUp
Columns("A:B").Select
Selection.Delete Shift:=xlToLeft
Columns("B:E").Select
Selection.Delete Shift:=xlToLeft
Columns("A:A").EntireColumn.AutoFit
Rows("2:2").Select
Selection.Delete Shift:=xlUp
Range("B1").Select
ActiveCell.FormulaR1C1 = "Existing userGroup"............................
View 2 Replies
View Related
Feb 6, 2008
The following code inserts a row below the selected row, and copies the formula of the row above into it.
Dim Rw As Integer
Rw = ActiveCell.Row
Selection.Insert Shift:=xlDown
Rows("" & Rw - 1 & ":" & Rw - 1 & "").Copy
Rows("" & Rw & ":" & Rw & "").Paste
However, I need to alter this to work for inserting more than one row at a time. ie. the user selects 'x' number of rows and 'x' rows are inserted below (in the same way 'Insert Row' works in Excel) and the row above the selection is copied down.
View 2 Replies
View Related
Feb 15, 2010
In the attached workbook I'm trying to populate Column E with sequential numbers (as shown) based upon a changing range (defined as a named range called 'range'). Is it possible to write a formula in the cells in Column E that will do this?
View 2 Replies
View Related
Jun 16, 2012
I'm trying to enter dates in order in excel 2010. But alot faster than manually entering each date. I've tried the date funtions only to be met with errors.
6/9
6/10
6/11
6/12
etc.
where each date is in a new cell.
View 3 Replies
View Related
Dec 16, 2012
auto fill the rows after selecting a particular option from a drop down list. For Ex., In Drop down list we have Cool drinks and Ice cream as two options. If i select Cool drinks the respective columns should be filled with brands like, Coke, 7 Up etc...
View 3 Replies
View Related
Feb 10, 2010
I have 2 sheets in the same workbook (sheet 1 & 2) with one matching column (A) of info and need them to combine and fill the missing data. Each sheet has identical column heading and the amount of data is not the same; sheet 1 has ~2000 rows and the other ~5000. Sheet 1 is consolidated so I would like to fill in the missing cells from sheet 2.
Ex. Sheet 1.......
Ex. Sheet 2.....
As you can see, the missing cells in sheet 1 could be filled from the data in sheet 2; also note that the above info is on different rows (and will be random for each case). I only want the columns to fill in that have a matching email, the other 3000 rows in sheet 2 do not match with sheet 1 and I don't want the rest of it to transfer over.
View 4 Replies
View Related
Mar 29, 2012
I get given a csv file on a monthly basis which contains consumption data per day for the specified period. This sounds simple but on occasion (more often than not) the data has missing days. This can cause me problem later on in my analysis.
I can happily total the monthly consumption using the date and month text. What i want to do however is to sort the csv file into daily consumption and highlight the missing days i.e. have a range of the days in the month and allocate the daily data to the correct date. I currently do this manually but know that there must be a better, automated approach... searching for matching dates for example?
In my head i'm thinking the following approach but lack the coding skills to do it.
1. Define the start and end dates. Perhaps count the number of days between the two dates and autofill the start date down the appropriate number of days in column A?
2. Paste the csv file into a different sheet and, starting from the top, cut and paste the csv data to the correct date created in step 1. Do this for each row based on the csv data.
View 1 Replies
View Related
Jul 17, 2008
I'm trying to setup a macro to run on a database extract that is sent to me. Some of the data is not filled in for each row and I want to automate the auto fill down for each entry based on the Reference # above. I searched the forum for terms that I thought might be related,
Here is the starting data: ...
View 10 Replies
View Related
Dec 20, 2006
I have a bit of a curly one - I have a sheet with 9,000 records that I need to expand to 24,000 + on a separate sheet records using the following method:
1) Select and Copy entire row 2 from sheet(1)
2) Insert a number of new rows into sheet(2), based on the value of cells(2,8) or cell H2. Column H contains quantity values for each of the 9000 rows which are variable.
3) Repeat for row 3, copying and inserting into sheet(2) based on the value of the cell in H3.
4) loop through all records until complete
I have tried writing the code in VBA but am not even getting close!
View 9 Replies
View Related
Jul 20, 2012
I am having trouble getting a VBA code to do the following:
2012/05/01 00:00:00
2012/05/01 00:03:00
2012/05/01 00:06:00
2012/05/01 00:15:00
2012/05/01 00:18:00
From this above to this below
2012/05/01 00:00:00
2012/05/01 00:03:00
2012/05/01 00:06:00
2012/05/01 00:09:00
2012/05/01 00:12:00
2012/05/01 00:15:00
2012/05/01 00:18:00
There are data entries next to these time stamps. I am able to create just the time stamps starting at the beginning and ending at the end of the month but I need it to fill in missing entries in a data set. The code below works but only some of the time. I have tried a few different things but nothing works.
Code:
Sub Insert_missing_3min()
'Inserts a row with the date and time where the missing date and time stamp is and a zero next to the date added.
Dim min3 As Date
Dim CurTime As Date
Dim CurCell As Date
Dim NextCell As Date
min3 = 3 / 24 / 60
[Code] ........
View 1 Replies
View Related
May 6, 2014
I have a set of data (assume 2 columns, one with a long name and the second with a time). The names contain variables that must be used as criteria (a single entry may contain "Blue" and "On"/"Off") and times vary, based on when the Name turns "On" or "Off" [in minutes: 25 (On), 47 (Off), 89 (On), 100 (Off) and 137 (On)]. I need to create another table that automatically inserts values for all times, to include the missing times (0 min thru 24 and 26 thru 46, etc.). EX: If the first entry is "Blue-On" at "25 minutes", the cells from 0 minutes to 24 minutes are each "0" and become a "1" at 25 minutes - the following cells are "1" until 47 minutes (where it is turned off). (1 and 0 represent "On" and "Off", respectively)
How can I created a formula to insert the correct numbers into the correct places? I'm willing to have multiple cells with formulas and simply hide the columns that are doing the calculations.
View 1 Replies
View Related