Date ranges in formula

ShoYnn

Board Regular
Joined
Mar 20, 2019
Messages
60
Office Version
  1. 2016
Platform
  1. Windows
I have a sumproduct formula that I am trying to figure out. It is for conditional formatting to ensure the same person does not get scheduled for multiple jobs during the same date range. The formula is:

=sumproduct((start date<=range of end dates)*(end date>=range of start dates)*(name=range of names))>1

It works sometimes, but I did some researching and found something interesting. If you throw each individual part in its own formula you find some neat things. The (start date<=range of end dates) always returns a 0, or false. So I simplified it and made a cell that just had =(range of end dates) and it gave me January 0 1900. Does anyone know why excel does this, and maybe a work around for it? Thanks!
 
The formula I suggested takes care of blanks as you can see in the mini-sheet I posted.
 
Upvote 0

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I did see that, and it takes care of the blank name cells, so perhaps a dynamic range won't be needed for that, but the date ranges still calculate out to 0, so the first part where it sees if the one start date is less than the any date in the end date range will always be false
 
Upvote 0
In what way did my suggestion not work?
 
Upvote 0
I mean, it totally worked, it just worked exactly how it did without the B4<>"", where the part where it compares the start date to the end date always comes out false
 
Upvote 0
If it worked, then what's the problem?
 
Upvote 0
The other issue I am having is that there is another section right under the top one, and I am trying to have the top cross reference the bottom and vice-versa, but if the top and bottom overlap they only highlight if something on the top matches something on the top. Maybe I am just trying to do too much...
 

Attachments

  • example 1.png
    example 1.png
    38.3 KB · Views: 2
Upvote 0
You would be far better off keeping it all in one set of rows, not multiple regions.
 
Upvote 0
Yeah, that does seem like the best course of action. I do greatly appreciate your help!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,812
Members
449,095
Latest member
m_smith_solihull

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