ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Increment dates (https://www.excelbanter.com/excel-discussion-misc-queries/33044-increment-dates.html)

kswinth

Increment dates
 

Hi there,

I'm sure this is simple, but I haven't found a simple solutions.

I'm creating a new timesheet for my company and I want it to populate
automatically.

I have a field where the payroll manager can enter the period start
date. From that, I want to fill in all of the dates for the payroll.

What I'm looking for is an easy way to lookup the date value in the
period start date field and then increment the dates in the body of the
worksheet.

What I have so far is something like this.

For the first day of the payperiod: =I$6
For the 2nd day of the payperiod: = I$6 + 1
For the 3rd day of the payperiod: = I$6 + 2

And so on. However, this is a tedius method of building up the date
range I want. It works, but I'm looking for something a little more
elegant.

Basically, I think I need a macro or something that does something like
that that can automatically increment the dates for me in the range I
want.

Can anyone point me in the right direction for writing something like
that? (I haven't worked much with Macros or VBA).

Kim


--
kswinth
------------------------------------------------------------------------
kswinth's Profile: http://www.excelforum.com/member.php...o&userid=24646
View this thread: http://www.excelforum.com/showthread...hreadid=383191


Nick Hodge

Kim

It's not clear what you want to make easier. Something like select a range,
click a button and it sets it up?

The formula you have looks good as you can simply change one date and the
rest will reflect

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"kswinth" wrote in
message ...

Hi there,

I'm sure this is simple, but I haven't found a simple solutions.

I'm creating a new timesheet for my company and I want it to populate
automatically.

I have a field where the payroll manager can enter the period start
date. From that, I want to fill in all of the dates for the payroll.

What I'm looking for is an easy way to lookup the date value in the
period start date field and then increment the dates in the body of the
worksheet.

What I have so far is something like this.

For the first day of the payperiod: =I$6
For the 2nd day of the payperiod: = I$6 + 1
For the 3rd day of the payperiod: = I$6 + 2

And so on. However, this is a tedius method of building up the date
range I want. It works, but I'm looking for something a little more
elegant.

Basically, I think I need a macro or something that does something like
that that can automatically increment the dates for me in the range I
want.

Can anyone point me in the right direction for writing something like
that? (I haven't worked much with Macros or VBA).

Kim


--
kswinth
------------------------------------------------------------------------
kswinth's Profile:
http://www.excelforum.com/member.php...o&userid=24646
View this thread: http://www.excelforum.com/showthread...hreadid=383191




Ron Rosenfeld

On Wed, 29 Jun 2005 10:18:02 -0500, kswinth
wrote:


Hi there,

I'm sure this is simple, but I haven't found a simple solutions.

I'm creating a new timesheet for my company and I want it to populate
automatically.

I have a field where the payroll manager can enter the period start
date. From that, I want to fill in all of the dates for the payroll.

What I'm looking for is an easy way to lookup the date value in the
period start date field and then increment the dates in the body of the
worksheet.

What I have so far is something like this.

For the first day of the payperiod: =I$6
For the 2nd day of the payperiod: = I$6 + 1
For the 3rd day of the payperiod: = I$6 + 2

And so on. However, this is a tedius method of building up the date
range I want. It works, but I'm looking for something a little more
elegant.


You could just refer back to each preceding cell and use the formula "preceding
cell" +1.

Or if your subsequent payperiod dates are in adjacent columns; you could use a
formulat of the type: =I$6 + COLUMN()-n where n is the column number of your
first column of data. The same principle can be used if the dates are in rows.

Then you simply copy/drag the formula down as needed.


--ron


All times are GMT +1. The time now is 03:09 PM.

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