Something like a vlookup with a range

ADAMC

Well-known Member
Joined
Mar 20, 2007
Messages
1,169
Office Version
  1. 2013
Platform
  1. Windows
Hi everyone. As always any help appreciated.
what I want to do an I’m sure it’s possible somehow!
Sheet 1:
Column M is a list of dates.
Sheet 2:
I would like to be able to enter a start date in A1 and an end date in B1 and underneath it will “lookup” all dates between those 2 ranges. From A3 down as well as corresponding cell in column O of sheet 1 on sheet 2 B3 down. Sort of like a vlookup but the dates may appear more than once for example there could be more than 1 01/07/2021 so I’d need to return all.
The reason I want to do this is because sheet 1 has 10 years of dates. But most often I’m only looking at roughly the next 4 weeks. The formula would mean that whenever I change the date range my linked graph would also update.
Many thanks if you’ve looked.
Adam.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
62,243
Office Version
  1. 365
Platform
  1. Windows
What version of Excel are you using

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also can you post some sample data, along with expected results

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 

ADAMC

Well-known Member
Joined
Mar 20, 2007
Messages
1,169
Office Version
  1. 2013
Platform
  1. Windows
Apologies. Yes I’ll fill in the details now.
Office 2013 standard.
Thanks.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
62,243
Office Version
  1. 365
Platform
  1. Windows
In the absence of any sample data, try in A3 copied down
Excel Formula:
=IFERROR(INDEX(Sheet1!$M$3:$M$200,AGGREGATE(15,6,(ROW(Sheet1!$M$3:$M$200)-ROW(Sheet1!$M$3)+1)/(Sheet1!$M$3:$M$200>=$A$1)/(Sheet1!$M$3:$M$200<=$B$1),ROWS(A$3:A3))),"")
 

ADAMC

Well-known Member
Joined
Mar 20, 2007
Messages
1,169
Office Version
  1. 2013
Platform
  1. Windows
This works great.
Thank you so much.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
62,243
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Forum statistics

Threads
1,141,051
Messages
5,703,957
Members
421,321
Latest member
blusky4

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
Top