Value Distribution across columns without exceeding value

dcalderwood

New Member
Joined
Aug 25, 2020
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I have been searching and searching and I have found a lot of great formulas, but none of them get me quite where I want to be. I have a worksheet that has every project we are working listed, it includes:
Column C: Start Date - let's say 4/15/2023
Column D: Number of weeks to complete - let's say 12
Column E: Calculated end date - with the examples we would see 7/8/2023
Column F: Number of hours for each department - for example Project Management would have 35 in this column
Column G forward each have a date of the week start

Row 1 is the calculated weeknum value, I'm using that in my current formula, so end date really isn't necessary:
=IF(ISBLANK($D3),"",(($F4/$D3)*AND(L$1<=(WEEKNUM($C$3,1)+$D3))))

I want to be able to distribute the 35 PM hours across all of the weeks within the date range, but I don't want it to exceed the 35 hours. I have managed to get it to distribute evenly, but I need whole number hours, and if there are an off number of hours remaining I want it to show that. For instance, the above examples provides a value of 2.91666667 to each column. If I round to 3, I end up with 36 weeks. So what I would like for it to do is distribute 3 across, and then the final week would have 2 hours. I hope this makes sense and I hope you can help. Thank you so much!

Current Formula

1682103583356.png
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Not sure this will get you where you need to, but what if you floor the math on every formula, except for the last, ceiling that one.
You would be more likely to get a better response if you posted an example sheet using Xl2BB.
 
Upvote 0
Not sure this will get you where you need to, but what if you floor the math on every formula, except for the last, ceiling that one.
You would be more likely to get a better response if you posted an example sheet using Xl2BB.
Unfortunately I don't think that will work as I'm not putting the formula in the specific columns I want the same formula across all columns, and have it know where to put the numbers. Which is the part that is working as it should.
 
Upvote 0
Unfortunately I don't think that will work as I'm not putting the formula in the specific columns I want the same formula across all columns, and have it know where to put the numbers. Which is the part that is working as it should.
Actually that formula is not working as I thought. I'm fixing that part now, and may have figured out my own question. I will update if I have it worked out.
 
Upvote 0
Actually that formula is not working as I thought. I'm fixing that part now, and may have figured out my own question. I will update if I have it worked out.
Hope you get it figured out! In the future, if you upload and example sheet using XL2BB, you are more likely to get a better response.

Cheers!
 
Upvote 0
OK, my apologies, I now have it working the way it should for the population evenly distributed, but still not figuring out how to make it essentially deduct as it populate and end with a final value that doesn't exceed the total.

New formula I'm working with is:
=IF(AND(G$1>=(WEEKNUM($C$3,1)),(G$1<=(WEEKNUM($E$3,1)))),$F4/$D3,"")

1682107631935.png
 
Upvote 0
Without an example worksheet, We can't really help you. Here is an example of an XL2BB mini sheet, with some formulas i added in, making some assumptions on your data and it's placement, Hopefully this will send you in the right direction.

D Calderwood.xlsm
H
11
Sheet1
 
Upvote 0
Hope you get it figured out! In the future, if you upload and example sheet using XL2BB, you are more likely to get a better response.

Cheers!
Forecast Dashboard.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAU
11314151617181920212223242526272829303132333435363738394041424344454647484950515253
2ClientProjectStart DateDuration (Weeks)End DateSOW Hours3/26/20234/2/20234/9/20234/16/20234/23/20234/30/20235/7/20235/14/20235/21/20235/28/20236/4/20236/11/20236/18/20236/25/20237/2/20237/9/20237/16/20237/23/20237/30/20238/6/20238/13/20238/20/20238/27/20239/3/20239/10/20239/17/20239/24/202310/1/202310/8/202310/15/202310/22/202310/29/202311/5/202311/12/202311/19/202311/26/202312/3/202312/10/202312/17/202312/24/202312/31/2023
3BJIAD Assessment and Remediation4/15/2023127/8/2023
4Project Management35  2.916672.916672.916672.916672.916672.916672.916672.916672.916672.916672.916672.916672.91667                          
5Operations14  1.166671.166671.166671.166671.166671.166671.166671.166671.166671.166671.166671.166671.16667                          
6Network/Security25  2.083332.083332.083332.083332.083332.083332.083332.083332.083332.083332.083332.083332.08333                          
Forecasting
Cell Formulas
RangeFormula
G1:AU1G1=WEEKNUM(G2,1)
E3E3=IF(C3,C3+(D3*7),"")
G4:AU4G4=IF(AND(G$1>=(WEEKNUM($C$3,1)),(G$1<=(WEEKNUM($E$3,1)))),$F4/$D3,"")
G5:AU5G5=IF(AND(G$1>=(WEEKNUM($C$3,1)),(G$1<=(WEEKNUM($E$3,1)))),$F5/$D3,"")
G6:AU6G6=IF(AND(G$1>=(WEEKNUM($C$3,1)),(G$1<=(WEEKNUM($E$3,1)))),$F6/$D3,"")
Named Ranges
NameRefers ToCells
solver_adj=Forecasting!$F$4G4:AU4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G4:AU6Celldoes not contain a blank value textNO
 
Upvote 0
The Start date should be consistent with G2:
The formula should be =IF(AND(G$1>=(WEEKNUM($C$3,1)),(G$1<(WEEKNUM($E$3,1)))),$F4/$D3,"")

T202304a.xlsm
ABCDEFGHIJKLMNOPQRSTUV
113141516171819202122232425262728
2ClientProjectStart DateDuration (Weeks)End DateSOW Hours26-03-2302-04-23Sun 09-04-2316-04-2323-04-2330-04-2307-05-2314-05-2321-05-2328-05-2304-06-2311-06-2318-06-2325-06-2302-07-2309-07-23
30AD Assessment and RemediationSun 16-Apr-231209-07-23
4Project Management35   2.916666672.91666672.91666672.91666672.91666672.91666672.91666672.91666672.91666672.91666672.91666672.9166667 
5Operations14   1.166666671.16666671.16666671.16666671.16666671.16666671.16666671.16666671.16666671.16666671.16666671.1666667 
6Network/Security25   2.083333332.08333332.08333332.08333332.08333332.08333332.08333332.08333332.08333332.08333332.08333332.0833333 
7
4b
Cell Formulas
RangeFormula
G1:V1G1=WEEKNUM(G2,1)
E3E3=IF(C3,C3+(D3*7),"")
G4:V4G4=IF(AND(G$1>=(WEEKNUM($C$3,1)),(G$1<(WEEKNUM($E$3,1)))),$F4/$D3,"")
G5:V5G5=IF(AND(G$1>=(WEEKNUM($C$3,1)),(G$1<(WEEKNUM($E$3,1)))),$F5/$D3,"")
G6:V6G6=IF(AND(G$1>=(WEEKNUM($C$3,1)),(G$1<(WEEKNUM($E$3,1)))),$F6/$D3,"")
 
Upvote 0
The Start date should be consistent with G2:
The formula should be =IF(AND(G$1>=(WEEKNUM($C$3,1)),(G$1<(WEEKNUM($E$3,1)))),$F4/$D3,"")

T202304a.xlsm
ABCDEFGHIJKLMNOPQRSTUV
113141516171819202122232425262728
2ClientProjectStart DateDuration (Weeks)End DateSOW Hours26-03-2302-04-23Sun 09-04-2316-04-2323-04-2330-04-2307-05-2314-05-2321-05-2328-05-2304-06-2311-06-2318-06-2325-06-2302-07-2309-07-23
30AD Assessment and RemediationSun 16-Apr-231209-07-23
4Project Management35   2.916666672.91666672.91666672.91666672.91666672.91666672.91666672.91666672.91666672.91666672.91666672.9166667 
5Operations14   1.166666671.16666671.16666671.16666671.16666671.16666671.16666671.16666671.16666671.16666671.16666671.1666667 
6Network/Security25   2.083333332.08333332.08333332.08333332.08333332.08333332.08333332.08333332.08333332.08333332.08333332.0833333 
7
4b
Cell Formulas
RangeFormula
G1:V1G1=WEEKNUM(G2,1)
E3E3=IF(C3,C3+(D3*7),"")
G4:V4G4=IF(AND(G$1>=(WEEKNUM($C$3,1)),(G$1<(WEEKNUM($E$3,1)))),$F4/$D3,"")
G5:V5G5=IF(AND(G$1>=(WEEKNUM($C$3,1)),(G$1<(WEEKNUM($E$3,1)))),$F5/$D3,"")
G6:V6G6=IF(AND(G$1>=(WEEKNUM($C$3,1)),(G$1<(WEEKNUM($E$3,1)))),$F6/$D3,"")
Thank you but that's not what I'm looking for. The start dates are determined by the project and entered based on planning for the project. The spreadsheet needs to automatically forecast the number of hours for each team, based on the start date, and total number of hours. I need it to distribute the hours within the timeline of the project. So that is working fine. My need is for it not to distribute them but not exceed the total hours. As in 3, 3, 3, 3, 3, 2, instead of 3, 3, 3, 3, 3, 3, which is more than that allowed hours in the project.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,157
Members
453,021
Latest member
Justyna P

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