Finding if a date range belong to a list of date ranges

skjohn

New Member
Joined
Jul 20, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have 2 excel tables, one has list of employees and their leave start date and end date.. Sample below. The second table has another table with Sprint data(Sprint no, Sprint Start Date, Sprint End Date). I want to check in which sprint the leave dates fall into and return the corresponding sprint no. At the moment I am using ifs formula as below- =IFS( D3=0,"", AND(B3<=$S$2,B3>=$R$2),$Q$2, AND(B3<=$S$3,B3>=$R$3),$Q$3,AND(B3<=$S$4,B3>=$R$4),$Q$4,AND(B3<=$S$5,B3>=$R$5),$Q$5,AND(B3<=$S$6,B3>=$R$6),$Q$6,AND(B3<=$S$7,B3>=$R$7),$Q$7,AND(B3<=$S$8,B3>=$R$8),$Q$8,AND(B3<=$S$9,B3>=$R$9),AND(B3<=$S$10,B3>=$R$10)).. However, this method is very difficult as the number of sprint increases. Is there a better way to do this.

Another formula I tried was

=IFERROR(INDEX(Sprint_Info_leave[#All],IF((Sprint_Info_leave[Start Date]<=$B3)*((Sprint_Info_leave[End Date])>=$B3),MATCH(Sprint_Info_leave[Start Date],Sprint_Info_leave[Start Date],0),"")+1,1),"") - this was only returning when the date is within Sprint 1.

Sprint Info is the table, where there is Sprint No, Sprint Start Date and Sprint End date
B3 had the leave start date of an employee.


Emp. NameStart DateEnd Date
ABC1
3-Aug-20​
7-Aug-20​
ABC2
27-Jul-20​
28-Jul-20​
ABC3
3-Jul-20​
3-Jul-20​
ABC
3-Jul-20​
6-Jul-20​
ABC2
3-Jul-20​
3-Jul-20​
ABC3
17-Jul-20​
20-Jul-20​
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

I could solve the issue using the concepts in this thread- Thank you Fluff.. your solution is very effective and viable.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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