Sam
Sam

Reputation: 65

Validate if date is in between two dates - Excel

I am trying to pull out a set of data based on a criteria of dates. If the event date does not fall between the Start and End Date, it should not be pulled into the results. IF it does fall in between those dates, It would then need to ensure that the Unique ID matches with the correct program. This would need to pull all the data associated to those particular events. All Unique ID and Program ID need to match and be pulled if it is between the Start and End Date.

enter image description here

End result should bunch up to the following

enter image description here

Upvotes: 0

Views: 1467

Answers (1)

Harun24hr
Harun24hr

Reputation: 36780

Use following formula to filter data between two date:

=IFERROR(INDEX($B$4:$H$10,SMALL(IF($B$4:$B$10>=$F$13,IF($B$4:$B$10<=$F$14,ROW($B$4:$B$10)-ROW($B$3))),ROWS($B$3:B3)),COLUMNS($B$3:B$3)),"")

As it is a array formula. Press CTRL+SHIFT+ENTER to evaluate the formula.

Put formula in B17 cell (as per example of below screenshot). Then drag and fill right and down as you need. Make sure you applied date format manually after filling formulas for date columns.

enter image description here

Upvotes: 1

Related Questions