Formula for returning value based on whether a date is between two dates
I have a main sheet and a reference sheet. On the main sheet there is a Fiscal Quarter which is based on a Program Date column. HOwever, I want to add a formula that refers to a reference sheet whereby I have two dates. If the Program date falls within the Start Date and End Date of a quarter, I want the formula to return the value from the Primary Column see below.
I thought Index Collect with two criterion would be best but I can't get it to work. Thoughts?
Best Answer
-
Hey @Pfarrell
You are right with using the Index/Collect
Try this. Note you must physically create the cross-sheet references in your sheet via the formula wizard window. You cannot simply copy paste this formula into your sheet. Your range names will look different than the ones I inserted in my formula- that is to be expected
=INDEX(COLLECT({Reference sheet Primary column}, {Reference sheet Start Date}, [Program Date]@row >= @cell, {Reference Sheet End Date}, [Program Date]@row <= @cell), 1)
Does this work for you?
Kelly
Answers
-
Hey @Pfarrell
You are right with using the Index/Collect
Try this. Note you must physically create the cross-sheet references in your sheet via the formula wizard window. You cannot simply copy paste this formula into your sheet. Your range names will look different than the ones I inserted in my formula- that is to be expected
=INDEX(COLLECT({Reference sheet Primary column}, {Reference sheet Start Date}, [Program Date]@row >= @cell, {Reference Sheet End Date}, [Program Date]@row <= @cell), 1)
Does this work for you?
Kelly
-
This worked perfectly. Thank you so much!!!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 439 Global Discussions
- 138 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 67 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!