How to bypass circular reference. Assigning holidays to staff schedule.

mafallaize

New Member
Joined
Aug 23, 2011
Messages
31
Hey guys,

I've been struggling with a problem for a few days, so decided to test the superior minds of MrExcel. If anyone can solve this, I'd be very grateful! Here's an example table for a staff schedule:

5/5/20165/6/20165/7/20165/8/20165/9/20165/10/20165/11/2016
On4333444
Required4325514
On minus required001-2-130
DaveOnWWOnOnOnOn
LarryOnOnOnWWOnOn
GeorgeWWOnOnOnOnOn
HenryOnOnOnOnOnWW
SteveOnOnWWOnOnOn

<colgroup><col><col span="7"></colgroup><tbody>
</tbody>

Each person needs 2 days off per week (W), and these are normally set the same each week. Sometimes however, days off need to be adjusted to meet requirements - this is shown as negative numbers in the row "On minus required".
So if a day has a negative number, holidays need to be moved to a less busy day to compensate.

Example: 5/08/2016 has -2, so Larry and Steve need their Ws moved to 5/10/2016, because 5/10/2016 is less busy with a 3 in the "On minus required" row.


The "On" row has the formula: =COUNTIF(E5:E9,"On") for each column. So if we use the formula =IF(E4<0,"On","W") a circular reference is produced.

Is there anyway to use formulas (or as a last resort VBA), to assign everyone holidays as required?

I look forward to your replies, thanks!

Mark
 

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
To circumvent the circular reference you can go to File>Options>Formulas>
And then over to the right is a thing called: " Enable iterative calculations "
Click on the box, and then below that set how many times you want it to circulate,
I think 3 to 4 will do you, but you may want to experiment with it...
 
Upvote 0

Forum statistics

Threads
1,215,353
Messages
6,124,464
Members
449,163
Latest member
kshealy

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