Function or Formula to get a value for each cell from multiple logical test.

markkeith

New Member
Joined
Sep 8, 2020
Messages
17
Office Version
  1. 365
Platform
  1. Windows
I'm newbie to VBA and have limited knowledge in making complex formulas in spreadsheet so I'm having difficulty thinking of a better approach to achieve my desired results.

I want each cell in multiple rows and columns to get a value of 1 or "" depending on the following logical test:
If Name and Date cell are blank then value is "" =IF(OR(E$2="",$B3=""),"","more formula")
If Employee is in Shift A then the cell in a row will get value of 1 from the start date up to certain numbers of cell depending of Work Rotation selected, employees in Shift B will start after the roster completion of Shift A.
Number of cell with 1 value will depends on rotation e.g. 3-3 Weeks (21 days on & 21 days off) or 6-2 Weeks (42 days on & 14 days off) and so on...
Also I want to get 0 in the 1st cell of days off, similar to the spreadsheet below.

Auto Roster Sheet_rev2.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASAT
1Week 32Week 33Week 34Week 35Week 36Week 37
2Name PositionShiftSun, 14 Aug 2022Mon, 15 Aug 2022Tue, 16 Aug 2022Wed, 17 Aug 2022Thu, 18 Aug 2022Fri, 19 Aug 2022Sat, 20 Aug 2022Sun, 21 Aug 2022Mon, 22 Aug 2022Tue, 23 Aug 2022Wed, 24 Aug 2022Thu, 25 Aug 2022Fri, 26 Aug 2022Sat, 27 Aug 2022Sun, 28 Aug 2022Mon, 29 Aug 2022Tue, 30 Aug 2022Wed, 31 Aug 2022Thu, 1 Sep 2022Fri, 2 Sep 2022Sat, 3 Sep 2022Sun, 4 Sep 2022Mon, 5 Sep 2022Tue, 6 Sep 2022Wed, 7 Sep 2022Thu, 8 Sep 2022Fri, 9 Sep 2022Sat, 10 Sep 2022Sun, 11 Sep 2022Mon, 12 Sep 2022Tue, 13 Sep 2022Wed, 14 Sep 2022Thu, 15 Sep 2022Fri, 16 Sep 2022Sat, 17 Sep 2022Sun, 18 Sep 2022
31Employee 1SupervisorA      11111111111111111111111111110
42Employee 2TradesmanA      11111111111111111111111111110
53Employee 3TradesmanA      11111111111111111111111111110
64Employee 4SupervisorB      1111111
75Employee 5TradesmanB      1111111
86Employee 6TradesmanB      1111111
9POB000000603333333333333333333333333330333333
10
11Start Date14-Aug-22
12End of Year31-Dec-22
13Days140
14Work Rotation4-4 Weeks
15
Sheet1
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Function or Formula to get a value for each cell from multiple logical test.
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Function or Formula to get a value for each cell from multiple logical test.
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
Apologies, I'm guilty for not reading the Forum rules before posting question here.

Here another post I made in other Forum.
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,361
Members
449,080
Latest member
Armadillos

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