If not the If Then Formula then what?

L2LGND

New Member
Joined
Oct 14, 2015
Messages
2
I will try to explain this the best I can!

I am attempting to create a schedule at work. In order to do so, I created three sheets. In the first sheet (Wkdays), I have included the names of each employee in column A. The rows (headings) I have labeled Sunday through Monday. I placed a 0 for days off and 1 for days worked for each employee.

On sheet two I have the daily assignment listed in Column A, with the headers Sunday through Monday (B1 through H1).To generate which employee will do what assignment, I used the function:=IF(Wkdays!B2=1,Wkdays!A2,"unassigned"), =IF(Wkdays!B3=1,Wkdays!A3,"unassigned"), IF(Wkdays!B2=1,Wkdays!A2,"unassigned"), =IF(Wkdays!B3=1,Wkdays!A3,"unassigned") and so on in column b. I used the same formula in each column making the appropriate adjustments to reference the sheet Wkdays.
This almost gave me what I wanted, however as a result of my formula there are several assignments listed as unassigned. I tried to figure out what formula to use so that if an employee had the day off (0), it would proceed to fill the next assignment with the next employee with the day worked (1), but I couldn't figure out how to do that , so I created a third sheet.

The third sheet is identical to sheet 2, however to get rid of the unassigned duties, I manually shifted the columns whenever an "unassigned" value appeared by cut and copying which gives me what I am looking for, but I know there must be a formula that avoid the need to manually cut and paste as I did in the third sheet.

Any help in this regard would be extremely appreciated.

-L2lgnd
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
[TABLE="width: 264"]
<colgroup><col><col span="2"></colgroup><tbody>[TR]
[TD][TABLE="width: 348"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Just for clarification, this is what sheet 2 looks like



ASSIGNMENT
[/TD]
[TD]



Sunday
[/TD]
[TD]



Monday
[/TD]
[/TR]
[TR]
[TD]Assignment 1[/TD]
[TD]unassigned[/TD]
[TD]unassigned[/TD]
[/TR]
[TR]
[TD]Assignment 2[/TD]
[TD]unassigned[/TD]
[TD]unassigned[/TD]
[/TR]
[TR]
[TD]Assignment 3[/TD]
[TD]Employee3[/TD]
[TD]unassigned[/TD]
[/TR]
[TR]
[TD]Assignment 4[/TD]
[TD]Employee4[/TD]
[TD]unassigned[/TD]
[/TR]
[TR]
[TD]Assignment 5[/TD]
[TD]Employee5[/TD]
[TD]Employee5[/TD]
[/TR]
[TR]
[TD]Assignment 6[/TD]
[TD]Employee6[/TD]
[TD]Employee6[/TD]
[/TR]
[TR]
[TD]Assignment 7[/TD]
[TD]Employee7[/TD]
[TD]Employee7[/TD]
[/TR]
[TR]
[TD]Assignment 8[/TD]
[TD]Employee8[/TD]
[TD]Employee8[/TD]
[/TR]
[TR]
[TD]Assignment 9[/TD]
[TD]Employee9[/TD]
[TD]Employee9[/TD]
[/TR]
[TR]
[TD]Assignment 10[/TD]
[TD]Employee10[/TD]
[TD]Employee10[/TD]
[/TR]
[TR]
[TD]Assignment 11[/TD]
[TD]Employee11[/TD]
[TD]Employee11[/TD]
[/TR]
[TR]
[TD]Assignment 12[/TD]
[TD]Employee12[/TD]
[TD]Employee12[/TD]
[/TR]
[TR]
[TD]Assignment 13[/TD]
[TD]unassigned[/TD]
[TD]unassigned[/TD]
[/TR]
[TR]
[TD]Assignment 14[/TD]
[TD]unassigned[/TD]
[TD]unassigned[/TD]
[/TR]
[TR]
[TD]Assignment 15[/TD]
[TD]Employee15[/TD]
[TD]unassigned[/TD]
[/TR]
[TR]
[TD]Assignment 16[/TD]
[TD]Employee16[/TD]
[TD]unassigned[/TD]
[/TR]
[TR]
[TD]Assignment 17[/TD]
[TD]Employee17[/TD]
[TD]Employee17[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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