IFERROR with IF/AND to catch between 2 dates with multiple results......and failing miserably :(

TheWaterDog

New Member
Joined
May 24, 2022
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I know there are people who are going to want to pull their hair out at my stupidity - I want to apologise in advance but I'm so stuck and I don't even know why.

Sheet 1 is Schedule Data (B4:Z4999)
Start Date is Column Y
End Date is Column Z
Data I want to be returned is Column B

Sheet 2 is Today

The below is what I'm trying to use for retrieval of items but only if today falls between the start and end dates of that item.

=IFERROR(INDEX('Schedule Data'!$B$4:$B$4999,SMALL(IF(AND($A$2>='Schedule Data'!$Y$4:$Y$4999,ROW('Schedule Data'!$Y$4:$Y$4999)-ROW('Schedule Data'!$B$4)+1),ROW(1:1))($A$2<='Schedule Data'!$Z$4:$Z$4999,ROW('Schedule Data'!$Z$4:$Z$4999)-ROW('Schedule Data'!$B$4)+1),ROW(1:1))),"Nothing found for today")

It hates me.
I hate me.
There's no error or calc issue - it's just returning "Nothing found for today" when I know that's wrong - there's about 100 of them that fall within the condition of it being today
(I butchered it from an iferror I had elsewhere that was returning other stuff without the need for the 2 dates)

I just need to be pointed in the right direction of what's wrong here, if anyone has a minute spare and was feeling particularly kind?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
As you have xl365 why not use Filter instead
Excel Formula:
=FILTER('Schedule Data'!$B$4:$B$4999,($A$2>='Schedule Data'!$Y$4:$Y$4999)*($A$2<='Schedule Data'!$Z$4:$Z$4999),"Nothing found for today")
clear all rows below the formula & it will spill down.
 
Upvote 0
Solution
FLUFF, YOU LEGEND!!!!

I didn't even realise you'd replied - and I've been avoiding going back to this document because my mental health just couldn't take it...and here you are, just being awesome and fixing stuff.

Thank you so much (I'm ashamed to say I've never even heard of =filter)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,692
Messages
6,126,230
Members
449,303
Latest member
grantrob

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