# Return value with a lookup (any) if date is within range - help needed

#### ernolander

##### New Member
Hi all,

I manage a list of properties, which are usually inspected monthly. Our master sheet has all 800 properties, and the inspection results are kept in a separate sheet (Resident Data.xlsx). Doing lookups to return these values has worked well, using both INDEX/MATCH and XLOOKUP - I match the listed name against the inspection report and return the inspection rating.
I've now been asked to produce a report that shows two results for each property, as the inspection schedule has increased to twice monthly. This is where my expertise fails...

Here's what I've tried in terms of IF statements:
=IF(AND('[Resident Data.xlsx]CL June 20 '!\$A:\$A>'June 20 Regions'!\$B\$34,'[Resident Data.xlsx]CL June 20 '!\$A:\$A<'June 20 Regions'!\$B\$35),XLOOKUP(A101,'[Resident Data.xlsx]CL June 20 '!\$C:\$C,'[Resident Data.xlsx]CL June 20 '!\$G:\$G),"")

\$B\$34 holds 31/5/20 as a date
\$B\$35 holds 16/6/20 as a date

This formula generates a false, ie, blank statement for every line.
When I modify it like this, to capture the later dated entries, everything shows up:

=IF('[Resident Data.xlsx]CL June 20 '!\$A:\$A>='June 20 Regions'!\$B\$35,(XLOOKUP(A101,'[Resident Data.xlsx]CL June 20 '!\$C:\$C,'[Resident Data.xlsx]CL June 20 '!\$G:\$G)),"")

I know I'm more than likely using the IF statements wrong, but any insight or help with this would be so welcome.

Many thanks,
Erik Nolander

### Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Replies
3
Views
173
Replies
18
Views
479
Replies
1
Views
147
Replies
4
Views
171
Replies
7
Views
122

1,126,945
Messages
5,621,760
Members
415,854
Latest member
Tutu123

### 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.

### Which adblocker are you using?

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

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