Increment dates

K

kswinth

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
 
N

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
(e-mail address removed)
 
R

Ron Rosenfeld

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top