Auto-fill using a date range formula

RapidFireGT

New Member
Joined
Mar 25, 2008
Messages
26
I have a spreadsheet showing a variety of inventory items (rows) and each item’s stock count for each week (columns). The spreadsheet should looks like this:

idealf.jpg




Each week’s date range spans 5 days (Monday – Friday). I would like to keep the most recent week as the left most column. Each week, a new column will be inserted in Column “C” and will have the inventory stock levels for the past week. Therefore, if we have had 5 weeks in the year so far, Column “C” will be Week 5, Column “D” will be Week 4, Column “E” will be Week 3, and so on.

When I insert a new column into Column “C”, I want to drag the date range formula from Column “D” to the new Column “C,” and it should auto-fill column “C” with the following week’s date range. My current formula is auto-filling the end-of-the-week date, but not the beginning-of-the-week date. For example, say our starting date is the first week of October. This week is Oct. 01 – Oct. 05.

Here is the original date:

beforesv.jpg



Here are the dates when I insert a new column at Coloumn “C”, and then auto-fill the date for Column “C” by dragging the formula from Column “D”:

aftert.jpg



As you can see, the ending dates are properly calculating (Oct. 12 for Week 2 and Oct. 5 for Week 1), although the beginning dates for these weeks are not properly calculating.

Here is the formula for the original Column C:
Code:
=TEXT(DATE(2012,9,24)+(COLUMN($C:C)-3)*(-7)+7,"mmm dd, 'yy")&" - "&TEXT(DATE(2012,10,1)+(COLUMNS($C:C)-3)*7+18,"mmm dd, 'yy")

Can anyone please correct my formula so that the beginning-of-the-week date also calculates properly?

Thanks guys!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Try this in C1 to start...

Code:
=TEXT(DATE(2012,10,1)+COLUMNS(D:$D)*7-7,"mmm dd, 'yy - ")&
    TEXT(DATE(2012,10,5)+COLUMNS(D:$D)*7-7,"mmm dd, 'yy")
 
Upvote 0
Try this in C1 to start...

Code:
=TEXT(DATE(2012,10,1)+COLUMNS(D:$D)*7-7,"mmm dd, 'yy - ")&
    TEXT(DATE(2012,10,5)+COLUMNS(D:$D)*7-7,"mmm dd, 'yy")

That did the trick! Thank you so much!

*Edit: For future reference, is there any option or procedure for marking threads as resolved?
 
Last edited:
Upvote 0
That did the trick! Thank you so much!

*Edit: For future reference, is there any option or procedure for marking threads as resolved?

You're welcome. You could use COLUMNS(C:$C) instead of COLUMNS(D:$D)

I don't think there is a "resolved" option.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,547
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top