even divisible by number of weeks in a month

Fahsid1230

Active Member
Joined
Dec 26, 2006
Messages
282
Hi Folks,
I have this unique situation and hoping someone will be able to help me.
on row1 (b/w col B to J) I have:
7/6/2008;07/13/08;07/20/08;07/27/08;08/03/08;08/10/08;08/17/08;08/24/08;08/31/08
now if I have a number in row 2 which is just associated to the month of July. That # is 169. How can I write a formula or is there a way to divide this # and solve two problems:
1) it should be divisible by 4 as you can see there are only four weeks, so it spread out just under July and it should be evenly spread as much as possible without any decimals.
So for example if it can be spread as (under July):
42; 42; 42; 43
and if there is number falls under the month which has five weeks, it should be evenly divided by 5 but in a way that I just have a whole number and no decimal.
Any help will be appreciated.
Thanks
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
without applying logic for calculating whether it is a 4 or 5 week month one solution would be as follows

assume your number is in B2 then

for a 4 week month, lets put the values in C1, C2, C3, C4,

C1 = INT($B$2/4)
C2 = INT($B$2/4)
C3 = INT($B$2/4)
C4 = $B$2 - SUM(C1:C3)

for a 5 week month, you would divide by 5

C1 = INT($B$2/5)
C2 = INT($B$2/5)
C3 = INT($B$2/5)
C4 = INT($B$2/5)
C5 = $B$2 - SUM(C1:C4)
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

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