populate cells based on table criteria.

Sandyclaws

New Member
Joined
Feb 21, 2018
Messages
1
Hi, I have been trying to find a neat way to do this but i haven't been successful.

I have this sheet

[TABLE="class: grid, width: 650"]
<tbody>[TR]
[TD][/TD]
[TD]Monday in[/TD]
[TD]Monday out[/TD]
[TD]Tuesday in[/TD]
[TD]Tuesday Out[/TD]
[/TR]
[TR]
[TD]Name1[/TD]
[TD]05:00[/TD]
[TD]13:00[/TD]
[TD]05:00[/TD]
[TD]13:00[/TD]
[/TR]
[TR]
[TD]Name2[/TD]
[TD]12:00[/TD]
[TD]18:00[/TD]
[TD]08:00[/TD]
[TD]17:00[/TD]
[/TR]
[TR]
[TD]Name3[/TD]
[TD]12:00[/TD]
[TD]18:00[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name4[/TD]
[TD][/TD]
[TD][/TD]
[TD]11:00[/TD]
[TD]15:00[/TD]
[/TR]
[TR]
[TD]Name5[/TD]
[TD]06:00[/TD]
[TD]11:00[/TD]
[TD]07:00[/TD]
[TD]12:00[/TD]
[/TR]
</tbody>[/TABLE]

What i'm trying to do is check who works after 05:00 but before 12:00 and add them to a list 1 name per row for the "AM" workers and if they work after 12:00 put them in a list for the "PM" workers.

example

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]AM[/TD]
[TD]Name1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Name5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PM[/TD]
[TD]Name2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Name3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Unfortunately i haven't been successful, the best i could do is come up with the formula that will check wether they work morning or evening and apply it to every cell. Which means that for 17 employees i have to allocate 17 cells and replicate the formula 17 times to check each cell individually which leaves me with a lot of blank cells because they have days off etc.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Sunday[/TD]
[TD]Monday[/TD]
[TD]Tuesday[/TD]
[TD]Wednesday[/TD]
[TD]Thursday[/TD]
[TD]Friday[/TD]
[TD]Saturday[/TD]
[/TR]
[TR]
[TD]Name1[/TD]
[TD][/TD]
[TD]Name1[/TD]
[TD]Name1[/TD]
[TD][/TD]
[TD]Name1[/TD]
[TD]Name1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name3[/TD]
[TD]Name3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Name6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

While i'm trying to make it write the results continuously like

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Sunday[/TD]
[TD]Monday[/TD]
[TD]Tuesday[/TD]
[TD]Wednesday[/TD]
[TD]Thursday[/TD]
[TD]Friday[/TD]
[TD]Saturday[/TD]
[/TR]
[TR]
[TD]Name1[/TD]
[TD]Name3[/TD]
[TD]Name1[/TD]
[TD]Name1[/TD]
[TD][/TD]
[TD]Name1[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]Name3[/TD]
[TD]Name6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Any help would be appreciated.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,223,897
Messages
6,175,269
Members
452,628
Latest member
dd2

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