ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VLook up question (https://www.excelbanter.com/excel-programming/433078-vlook-up-question.html)

Wolfwalker721

VLook up question
 
I have 2 colums of data as follows

1-1-05 2
3-1-05 3
5-1-05 5

I need to fill in the blanks with the previous dates value

so I need to end up with
1-1-05 2
2-1-05 2
3-1-05 3
4-1-05 3
5-1-05 5
6-1-06 5

I have the dates set up in a different column, but I need help to get the
data there


I hope this makes sence...
Thanks in advance for your time

Wolfwalker

smartin

VLook up question
 
Wolfwalker721 wrote:
I have 2 colums of data as follows

1-1-05 2
3-1-05 3
5-1-05 5

I need to fill in the blanks with the previous dates value

so I need to end up with
1-1-05 2
2-1-05 2
3-1-05 3
4-1-05 3
5-1-05 5
6-1-06 5

I have the dates set up in a different column, but I need help to get the
data there


I hope this makes sence...
Thanks in advance for your time

Wolfwalker


Assuming your first columns are A:B, and the second set of dates is in
column D, place this formula in E1 and fill down:

=VLOOKUP(D1,$A$1:$B$3,2,TRUE)

Don Guillett

VLook up question
 
try this idea

Sub fillinmissing()
mc = 1 'col A
For i = Cells(Rows.Count, mc).End(xlUp).Row To 1 Step -1
If Cells(i - 1, mc) < Cells(i, mc) Then
Rows(i).Insert
Cells(i, mc) = Cells(i - 1, mc) + 1
Cells(i, mc + 1) = Cells(i - 1, mc + 1)
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Wolfwalker721" wrote in message
...
I have 2 colums of data as follows

1-1-05 2
3-1-05 3
5-1-05 5

I need to fill in the blanks with the previous dates value

so I need to end up with
1-1-05 2
2-1-05 2
3-1-05 3
4-1-05 3
5-1-05 5
6-1-06 5

I have the dates set up in a different column, but I need help to get the
data there


I hope this makes sence...
Thanks in advance for your time

Wolfwalker



Wolfwalker721

VLook up question
 
This is fabulous!

The one problem is that it only adds a day to the date instead of a month.

"Don Guillett" wrote:

try this idea

Sub fillinmissing()
mc = 1 'col A
For i = Cells(Rows.Count, mc).End(xlUp).Row To 1 Step -1
If Cells(i - 1, mc) < Cells(i, mc) Then
Rows(i).Insert
Cells(i, mc) = Cells(i - 1, mc) + 1
Cells(i, mc + 1) = Cells(i - 1, mc + 1)
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Wolfwalker721" wrote in message
...
I have 2 colums of data as follows

1-1-05 2
3-1-05 3
5-1-05 5

I need to fill in the blanks with the previous dates value

so I need to end up with
1-1-05 2
2-1-05 2
3-1-05 3
4-1-05 3
5-1-05 5
6-1-06 5

I have the dates set up in a different column, but I need help to get the
data there


I hope this makes sence...
Thanks in advance for your time

Wolfwalker





All times are GMT +1. The time now is 08:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com