Need help about formula

ybr_15

Board Regular
Joined
May 24, 2016
Messages
204
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
Hi, I have shift calendar template from this site

I am a bit puzzled to explain so I will use the following image below:
EXCEL_2017-04-06_14-19-00.png


Based the image, I have schedule like this:
EXCEL_2017-04-06_14-28-52.png

Then if I see highlight in the calendar, I get wrong highlight (I marked with a red horizontal line). The range in red horizontal line should not be highlighted. The problem is with this formula:
<mindate;b5><mindate;b5><mindate;b5><mindate;b5><mindate;b5><mindate;b5>
EXCEL_2017-04-06_14-52-13.png

Can anyone here help me to fix the formula so I get highlight to work properly like I want?

If you need file, here example file that I edited:
https://www.dropbox.com/s/ixq14dqoondegvu/shift-calendar-template-EDIT.xlsx?dl=0

Thanks..</mindate;b5></mindate;b5></mindate;b5></mindate;b5></mindate;b5></mindate;b5>
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I don't think the template is designed to cater for breaks between shifts so it assumes that the previous shift starts on the date before the next one. In your case, "Vacation" starts on 16-Jan so it assumes "Day Shift" ends on 15-Jan. It would need some work to cater for non-sequential shifts. Try this formula in B15 and copy across and down:

Code:
=IF(OR(B5<minDate,B5>maxDate),0,IFERROR(IF(B5<=VLOOKUP(B5,tblShifts,2),VLOOKUP(B5,tblShifts,3)*(MONTH(B5)=$C$12),0),0))

WBD
 
Upvote 0
Hi, wideboydixon

Thanks alot. Your code work properly
:biggrin:

Btw, Can you tell me a little about your formula work? thank you
 
Upvote 0
I just changed the formula to check the date is also before the end date of the shift:

Code:
B5<=VLOOKUP(B5,tblShifts,2)

WBD
 
Upvote 0

Forum statistics

Threads
1,215,562
Messages
6,125,546
Members
449,237
Latest member
Chase S

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