Breaking costs down by calendar week

Akira181

Board Regular
Joined
Mar 23, 2010
Messages
67
Office Version
  1. 365
Platform
  1. Windows
I've been stuck on this for quite a while and I don't think this can be done without VBA of some sort, which I am terrible at. Hope someone can offer some advice!

On the first worksheet, I have the below table. Column B, is a drop-down with the 4 options displayed.

COST ITEMCOST INTERVALCOST WEEK (FIRST)DURATIONFREQUENCYTOTAL COST
AOneOff6 - -50
BMultiWeek36-600
CRecurring1324200
DUserDefine7 - -10

On a second worksheet, I have something similar to the below but for the full year
CW1234567
Cost Item
A
B
C
D


I'm trying to break the costs down from the first table by calendar week in the second table, depending on the COST INTERVAL option selected in the dropdown. I would like the cost intervals to do the following:

OneOff will copy the Total Cost to the corresponding week in the second table according to COST WEEK
MultiWeek will take the Total Cost, divide it by the DURATION in Column D, and put the result in the corresponding weeks in the second table (in this case, weeks 3 to 9)
Recurring will take the Total Cost, divide it by the DURATION in Column D, and put the result in the corresponding weeks in the second table (in this case, Weeks 1, 6 and 11. 3 times (column D) in 5 weeks (Column E))
UserDefine will change the current worksheet to the second and the user will manually go to the corresponding week and enter the data in

OneOff I can do with a lookup or index& match forumula. Multiweek and Recurring I'm messing around with formulas and think I might be able to get it although it's beginning to look quite convoluted.

My probelm is the UserDefine option. I think this needs VBA to go to that worksheet and the other problem is that if the user manually enters a value, it will erase any formula in the cell.

Does anyone know of a better way to do this or how I can go about learning the VBA required to do this neatly?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
how does excel know what week to start?
 
Upvote 0
how does excel know what week to start?
The start week would be defined by the COST WEEK column in the first table. Just realised it would have probably helped if I manually created the second table to show what I want to do.

cw12345678
Cost Item
A50
B100100100100100100
C8.338.338.33
D10


COST WEEK defines when the spend will happen (except for when USERDEFINE dropdown is selected, there the user will manually enter the data, deleting the formula within the cell if need be)
DURATION will define for how long the activities will last (MULTIWEEK is a continous duration with the cost divided accordingly, RECURRING is a recurring time based thing. In this example, a task that's going to happen every 3 weeks, starting from the 1st week, for 24 weeks, as defined by frequency. 7 times in total)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,734
Members
448,987
Latest member
marion_davis

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