Find Starting Date And Fill In The Following Months Until End Date

Mar 4, 2013

I have collected some data on economic factors for different countries. Unfortunately, the dates when I started to calculated my economic factors are different for each country (due to the data available to me).

What I would like Excel to have done is to take the date when I started to measure for e.g. country A (D3 ie 30/06/2007), copy it into column "I" (for country A, it's cell I3) and fill in the following months in the rows below (with always the date of the last day of a month) until it reaches 28th of Feb 2013. Then, it should go up to the next country (country B) take the starting date (D4, ie 31/07/2007), go to the last entry in "I" (ie I71) and paste the date in, fill in the months until 28th of Feb 2013, do the same for country C and so on.

I have started to code a VBA but I am unfortunately a beginner in VBA and totally stuck at the moment. My VBA code does paste in the months but for some reason, it also changes the starting date of the first month.

Moreover, I tried a workaround for the fact that Excel doesnt know when to stop; ie I introduced a "monthdiff" variable which should calculate the number of months between the starting date (which is variable and unique for each country) and the end date (which is always 28th of Feb 2013). At the moment, it only does this for country A.

VB:
Set rng = ActiveSheet.Range("I3" & Cells(monthdiff, "I").Address)[SIZE=4][/SIZE]

I have tried to make this dynamic but have been unsuccessful so far.

Spreadsheet with data&code is attached.

VB:
Sub Macro1()
Dim mainrange As Range
Dim rng As Range

[Code].....

View 3 Replies


ADVERTISEMENT

Use Closest Date To Find The Starting Mileage Of Car?

Dec 26, 2012

I have a list with all our company cars (300). I also have a list with all the transactions of the fuel cards (12000 lines). Now I need the find for every company car (exact match) the nearest fuel-consumption-date (closest match to the given starting date) and take the mileage of that transaction. I've added an example. I have tried linking carnr and date (like carnr&"#"&date) and match these, but I don't always get the right car number.

View 1 Replies View Related

Show Week Number Of Today Date From Starting Date

Jun 27, 2014

is it possible to display the week number of todays date (today()) from a physically entered start date (which would obviously be week one), the start date would be november 4th 2013.

View 3 Replies View Related

Excel 2010 :: Find Months And Days Between Today And Another Date That Is Result Of Function?

Apr 25, 2014

I'm in Excel 2010, and the cell with the date I want to work from is H22.

I'm trying to get the difference of the (date+12 months)-TODAY() to appear in months and days.

Here's the latest thing I tried (that doesn't work):

=IF(DATEDIF(H22,TODAY(),"y")>=1,DATEDIF(H22,TODAY(),"y")&" yrs, "&DATEDIF(H22,TODAY(),"ym")&" mths,
"&DATEDIF(H22,TODAY(),"md")&" days",IF(DATEDIF(H22,TODAY(),"ym")>=1,DATEDIF(H22,TODAY(),"ym")&" mths, "&DATEDIF(H22,TODAY(),"md")&" days",DATEDIF(H22,TODAY(),"md")&" days"))

I should also probably note that the date in H22 is the result of another function.

=EDATE(G22,12)

View 5 Replies View Related

Creating View By Filtering 2 Columns By Date (both Within 3 Months Of Today Date)

Mar 20, 2014

Trying to do a linkback from another post located here but not having much luck doing it: [URL]

I'm working with 2 date columns and trying to filter a view to only include projects with dates within 3 months of today's date.

I've attached a current working file of the data and the end result i'm hoping to achieve via a macro of some sort.

I've manually got it to work via formula by inserting 2 additional columns (highlighted yellow) which determine if the dates "YES" fall in this 3 month time frame of "" blank if not.

create a macro which does all of this automatically without modifying any columns if this is possible

View 5 Replies View Related

Filter Data By Date Within 3 Months Of Today Date?

Mar 20, 2014

I'm trying to filter 2 date columns to include only data containing dates within 3 months of today's date.

I see there is a data filter option for "next quarter" but not 100% sure if this covers the quarter from today's date?

View 3 Replies View Related

Calculate Date Six Months From Cell Date

Jan 25, 2010

I have a start date for a contract in cell AM1. I need AN1 show a date six months from the start date in AM1. I am fine with that part.

However, I would like for AN1 to calculate not only a six-month date but also to auto-update to the next six month date from AM1 once the first six month date is about, let's say, one month past. What I am doing is calculating when a six-month inspection needs to be completed; these inspections are ongoing, so I need them to auto-update.

So let's say a contract was awarded today, 25 JAN 2010. That would be value in AM1.

I want AN1 to produce a date six months from 25 JAN 2010, which would be 25 JUL 2010 (yes, this way of calculating the six month date is fine). Then around, let's say, 25 AUG 2010, I want AN1 to auto-update to produce the next six month date, which would be 25 JAN 2011 (six months from 25 JUL). Obviously the function would need to relate to TODAY() in some way.

View 11 Replies View Related

Elapsed Months (many Months Have Gone By Since Todays Date)

Jul 19, 2009

Cell A1 is a past date. In cell B1 I would like how many months have gone by since todays date. eg. Cell A1 = July 07, B1 would = 24 months.

View 3 Replies View Related

Fill Date Across Columns Based On User Date Range Input?

Mar 5, 2014

based on user date ranges entered on sheet1, I'm trying to write code that will write each month of the date range on other sheets across the 2nd row. at this point I'm getting "object required" error at "Set DateStart = Cells(2, 6)"

I also want the date format to be mmm-yy (Mar 14) on the sheets even if sheet1 has a different format. I tried using sourcerange instead of DateStart, but that didnt work either.

Code:

Dim projStartDate As Date
Dim projEndDate As Date
Dim DateStart As Date[code]....

View 1 Replies View Related

Fill Table Based On Another Within Date Range & Cut Off Date

Dec 31, 2009

I have an 'existing results table' as per my attached sample.

I have had help previously from this forum to create lists of 'sold' stock within date ranges (tax year periods) and these are represented as 'sold list' in my attached sample.

I now need to create a list of 'unsold stock' for each annual tax year end date; i.e. populate my table with items that have been created before the end of the date range and that have not been sold by the end of the date range.

Please can someone show me the formula on my attached sample?

Please see my example in red.

I am working with Excel07 however my attached sample is in Excel03 because I couldn't upload an XLSX file.

View 8 Replies View Related

Fill Date Series To Todays Date Using VBA

Aug 26, 2013

I am trying to write a simple code that will take the last date in Col A and fill down until it gets to todays date.

Code:
Sub Fill_down_date()
Dim x As Integer
lr2 = Worksheets("sheet2").Cells(Rows.Count, "A").End(xlUp).Row
For x = lr2 To 20
If Cells(x, 1).Value < Date Then
Cells(x + 1, 1).Value = Cells(x, 1).Value + 1
If Cells(x, 1).Value

View 6 Replies View Related

Dateif Function That Counts The Starting Date?

Jul 28, 2014

I have the following formula to count the time between two dates and result in an answer with months/days:

=DATEDIF(E14,E15,"M")&" months "&DATEDIF(E14,E15,"MD")&" days"

The problem is that the function does not count the start date. Is there any way to modify this formula so that the start date is included?

For example if the start date is 02/01/2012 and the end date is 02/28/2012 it results in 27 days but I want it to result in 28 days or 1 month.

how to go about this or if there are any better date functions out there?

View 2 Replies View Related

Need Function To Write The Starting Date And Time Immediately

Feb 16, 2010

Ihave this exel sheet i nedd function to write the starting date and time immediatly after i enter the name in the last colume ineed from exel to write the date and time emmideatly if the case is (done, cancelled ,or rejecteted)if the case is (select status )i want the cell empty but if the case is (pending)iwant to the program to calculte the deffirence between the ClosingDatetimee(which written by the program)and the delivering date(which entered manually by user)

View 9 Replies View Related

Roll On Date 11 Months In One Cell When Another Cell (date) Is Amended

Jun 5, 2009

I have had a look via search for similar but I'm not good enough to recognise whether other threads bear any relation to my query.

I have a small spreadsheet with basic conditional formatting (my level!) where we record agency staff for eleven months service to enable us to ask them to take a four week break.

I want to add a formula or similar to automatically roll the date forward eleven months when we amend the re-commencement date on their return.

E.g. we type in A1 01/01/09, B1 updates to 30/11/09

Is this possible?

View 10 Replies View Related

Repeat Amount For Number Of Columns With Month Name Starting From Delivery Date?

Feb 12, 2013

I want formula which can automatically populate the amount based on the number of months starting from the date vehicle is received. For Eg.

Nissan patrol Rent is AED 5800/- per month & we deliver it on month Sept 2011 for 24 months then i want excel to automatically populate AED 5800/- for next 24 months starting from Sept 2011.

View 5 Replies View Related

Create A Macro That Will Autofilter My Starting Dates In I To The Newest Date Entered

Feb 11, 2008

i wanted to create a macro that will autofilter my starting dates in I to the newest date entered. So ive recorded the macro: ....

View 9 Replies View Related

Date More Than 11 Months Using VBA

May 5, 2008

My boss asked me to create a workbook that notify you when the date in the sheet is more than 11 months old.

In column A has list of street names and in column B is where the dates of completed Footpath Replacement occured by the contractors.

We have to check those new footpaths before 12 months up otherwise contractors will not have to return to fix any fault they made.

So what is the code be in Visual Basic Editor with the message box to warn you of any date that is 11 months old?

View 9 Replies View Related

Add Months To Date

Jul 10, 2008

I have managed to create a formula to add a date (contained in cell E3) to a number of months (contained in cell F3).

This formula is in cell G3
=DATE(YEAR(E3), MONTH(E3)+(F3+1), 0)

This works fine. Apart from before I put information into E3 and or F3 then G3 displays "31/01/1900". I wish G3 to remain empty until information is entered into both E3 and F3.

I have used data validation on cell E3 to restrict users to enter a date between 01/01/1980 and 01/01/2099.

View 9 Replies View Related

Add X Months To Date

Jan 30, 2008

I have a macro that adds a text in column H if criteria is met. In column Q I have a date field. I'd like to add 3 months to that date and put the result after my text below, so it would look something like this:

"FORCE-MATCH CANDIDATE < $5K ICDP, 01-04-2008".

Is it possible to do relatively easy?

Sub ForceMatch()
Dim ws As Worksheet
Dim line As Integer
Dim Endline As Long
For Each ws In Worksheets
If ws. Name <> " Total" And ws.Name <> "Batch" And ws.Name <> "Summary" And ws.Name <> "PivotTable" And ws.Name <> "Fields" Then..............

View 3 Replies View Related

Find Corresponding Date Range Based On Single Date And ID Number

Mar 28, 2014

I'm trying to combine the hours that a employee worked on a single date, with one of multiple time periods that exist for that employee.

I have two sets of data.
Set 1 (hours)
Employee number, date, hours
12345, 1-2-2014, 6
12345, 1-3-2014, 8
12345, 1-10-2014, 8

Set 2 (periods)
Employee number, start date, end date
12345, 1-1-2014, 4-1-2014
12345, 6-1-2014, 1-2-2014

What I'd like to do is to add the start and end date of Set 2 to Set 1 for every row in Set 1

In above example the result should be like this.
12345, 1-2-2014, 6, 1-1-2014, 4-1-2014
12345, 1-2-2014, 8, 1-1-2014, 4-1-2014
12345, 1-10-2014, 8, 6-1-2014, 1-2-2014

View 13 Replies View Related

How To Get The Date Of 3 Months Ago From Today

Aug 30, 2013

I have to figure out the date of 3 months ago from today. The rule is:

1) if today is the month end (e.g. 30/06/2013), then 3 months ago will also be the month end (e.g. 31/03/2013).

2) if today is not the month end (e.g. 10/06/2013), then 3 months ago will have the same day (e.g. 10/03/2013). But this has some exceptional case, because some month has 30th while other month does not. For example, if today is 30/05/2013, then 3 months ago will be in February which does not have 30th. In this case, just make it as the month end of 3 months ago.

View 5 Replies View Related

Sumproduct Between A Date And Next 6 Months

Jan 24, 2013

I have written the formula below that returns to me a total value of all products named ABCD where date is greater than in A3 which works fine.

=SUMPRODUCT(($CE$4:$EW$4>$A$3)*($A$5:$A$85="ABCD")*($CE$5:$EW$85))

CE4:EW4 = date range (Format MMM-YY)
A3 = A single date (format MMM-YY)
A5:A85 = Column of product names
CE5:EW85 = values

I am looking to add to this criteria to return where date is > A3, but only for the next 6 months.

View 9 Replies View Related

Increment Date Every 6 Months?

Dec 22, 2013

If I have a date in a cell. Let's say A2 is 12/1/2012. Six months later I would like that date to increment 6 months and display 6/1/13. When the date in A2 is 12 months old I want the date to increment another six months and show 12/1/2013. Basically, every time the date reaches a 6 month anniversary from the initial date found in A2 it would increment another 183 days.

The reason I'm trying to do this is to create a rolling reminder so I can followup with customers every 6 months.

If it's not possible without creating some sort of final end-date to the cycle I guess it would be okay if it ended after 3 or 4 years.

What would be the best method to do this?

View 2 Replies View Related

Subtracting Months From A Date

Aug 14, 2007

If I have a date in Cell A1, what formula do I need to put in cell B1 to subtract 6 months.

eg If A1 = 14/08/2007 I want B1 to read 14/02/2007 and not 12/02/2007 which it reads when subtracting half a ywears worth of days

View 9 Replies View Related

Add X Months Or Days To Date

Jul 29, 2009

I use [=IF(F15="","",EDATE(F15,-D15))] to track time frames. The problem is Edate works great for months but on occasion I need days, like 40 days. In cell D15 I have a list where the user must choose from, but one of the choices needs to be in days so the Edate won’t work anymore.

View 5 Replies View Related

Formula For 6 Months From A Certain Date

Mar 6, 2006

I came up with a formula that i thought should work but apparently not so could someone be kind enough to post a formula that will take the date in one cell and place it in another but showing 6 months later.

View 9 Replies View Related

Subtract/Take X Months Off Date

Apr 18, 2008

A1 contains an entered date (4/18/08). B1 contains an entered number representing months (6). I want C1 to subtract 6 months from 4/18/08 and then show the rounded down date of 10/1/07.

View 9 Replies View Related

Find Pay Date From Date Sold (Friday Of Following Week)

Feb 17, 2014

If a sale was made between 2/09/2014 - 2/15/2014 return the date of the following weeks Friday. In this case 02/21/2014.

View 3 Replies View Related

Find Date Less Or Greater Than Particular Date From Range Of Cells?

Dec 12, 2011

way to search and display a date from a range of cells based on less than or greater than criteria. For example I have following dates in column A:

A1: 2011/01/04
A2: 2011/02/01
A3: 2011/03/01
A4: 2011/04/01

I want to search for the date which is less than 2011/02/01 from the A column and display that date in B1 cell for example. How do I do that?

I want to do this without using any macros.

View 9 Replies View Related

Return 12 Months From Year End Date?

Apr 17, 2014

Someone will enter their financial year end in the worksheet e.g. 31/03/2014 and I then have 12 cells below it called Month 1, Month 2 etc up to Month 12. I need the cell next to Month 1 to calculate what it would be... so for a Year End of 31/03/2014 month 1 would be April and this needs to apply to the 12 months.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved