Date Range IF, Then Else

charlies_stuck

New Member
Joined
Oct 4, 2022
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi All - Not sure what to search on for this, and so posted it ....thanks for any help in advance.

Im not very advanced in xls...

I would like a formula that looks up a date and returns a value or joined value in a new cell.

So

Sheet 2 is

1664942585998.png


and Sheet 1

1664942975913.png


The rules in simple terms
Check Start date in Sheet1 (B2:B5) against the list in Sheet2 Col D (D2:D16)
and
where the Start date in Sheet 1 is equal or greater than Sheet2 Col D (D2:D16) but less than Sheet2 End Date (E2:E16)
Then
Populate Sheet2 Col D with the corresponding Sheet2 Sprint and Sheet2 Col E with the coresponding Week
And if no match then "" (blank)


I need this as I have a long list of tasks in a project that can have date changes and i would rather have it done automatically.

Also...bonus karma is you know how to do this as a MS Project Formula :)

Thanks

C

PS hope i made sense.
 

Attachments

  • 1664942199702.png
    1664942199702.png
    10.3 KB · Views: 9

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Hi All - Not sure what to search on for this, and so posted it ....thanks for any help in advance.

Im not very advanced in xls...

I would like a formula that looks up a date and returns a value or joined value in a new cell.

So

Sheet 2 is

View attachment 75457

and Sheet 1

View attachment 75458

The rules in simple terms
Check Start date in Sheet1 (B2:B5) against the list in Sheet2 Col D (D2:D16)
and
where the Start date in Sheet 1 is equal or greater than Sheet2 Col D (D2:D16) but less than Sheet2 End Date (E2:E16)
Then
Populate Sheet2 Col D with the corresponding Sheet2 Sprint and Sheet2 Col E with the coresponding Week
And if no match then "" (blank)


I need this as I have a long list of tasks in a project that can have date changes and i would rather have it done automatically.

Also...bonus karma is you know how to do this as a MS Project Formula :)

Thanks

C

PS hope i made sense.

Sorry Cant see how to edit.

Think I got it wrong ..dooh

Check Start date in Sheet2 (B2:B5) against the list in Sheet1 Col D (D2:D16)
and
where the Start date in Sheet2 is equal or greater than Sheet1 Col D (D2:D16) but less than Sheet1 End Date (E2:E16)
Then
Populate Sheet2 Col D with the corresponding Sheet1 Sprint and Sheet2 Col E with the corresponding Week from Sheet1 Col C
And if no match then "" (blank)
 
Upvote 0
See if this works for you.

20221005 Lookup Filter charlies_stuck.xlsm
ABCDE
1TaskStartFinishSprintWeek
2Lunch13/06/202212/07/2022Sprint 6Week 3
3Dinner11/07/202217/08/2022Sprint 7Week 2
4Supper5/09/202224/12/2022 
5Drink3/10/202221/01/2023 
Sheet1
Cell Formulas
RangeFormula
D4:D5,D2:E3D2=FILTER(Sheet2!$A$2:$B$11,(Sheet2!$C$2:$C$11<=$B2)*(Sheet2!$D$2:$D$11>=$B2),"")
Dynamic array formulas.


And in case anyone else want to try, this is my sheet 2 as an XL2BB

20221005 Lookup Filter charlies_stuck.xlsm
ABCD
1SprintWeekDateEnd
2Sprint 6Week 130/05/20224/06/2022
3Sprint 6Week 26/06/202211/06/2022
4Sprint 6Week 313/06/202218/06/2022
5Sprint 6Week 420/06/202225/06/2022
6Sprint 6Week 527/06/20222/07/2022
7Sprint 7Week 14/07/20229/07/2022
8Sprint 7Week 211/07/202216/07/2022
9Sprint 7Week 318/07/202223/07/2022
10Sprint 7Week 425/07/202230/07/2022
11Sprint 7Week 51/08/20226/08/2022
Sheet2
Cell Formulas
RangeFormula
D2:D11D2=C2+5
C3:C11C3=D2+2
 
Upvote 0
It would be nice if you could convert it MS Project to save the export, update and import, so it would go on the fly. The MSP formulas are a bit trickier and I think you would maybe have to list out all the Sprints similar to an SQL script (maybe). Must say, I am surprised that the MSP Project Field Called "Sprint: is not dynamically linked to date (as that is to all intents and purposes a lu table)

The MSP Formula box example is

1665039345291.png


Clearly I got something right as its returning unknown

Sprints in MSP are

1665039574825.png


Maybe theres a switch i need to turn on in MSP.

In the meantime - thanks for the help thus far.

Cheers
 
Upvote 0
I'm afraid I don't know anything about MS project. There is a section for General discussion and Other Applications, if you wanted to try it there.
It might be worth putting MS Project in the subject line so you attract people with expertise in that.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,605
Members
449,089
Latest member
Motoracer88

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