Formula to find lookupvalue between two separated date

WashingtonDC74

New Member
Joined
May 29, 2020
Messages
4
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
Hi,

I'm facing to an issue.

Indeed, I would like to find the weeknumber rounds up a date.

I have 2 columns which represent each starting date/ending date of one week.

For instance, I would like to find as output "2020/03" as of this input "17-1-2020 (January 17th, 2020)

1590754080796.png


I tried all of lookup formula (XLOOKUP,VLOOKUP,HLOOKUP,INDEX,MATCH) but no successful

I looking forward your ideas regarding my topic!

BR
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
How about
+Fluff New.xlsm
ABCDE
1
22020/0101/01/202007/01/2020
32020/0208/01/202014/01/202017/01/2020
42020/0315/01/202021/01/20202020/03
52020/0422/01/202028/01/2020
62020/0529/01/202004/02/2020
72020/0605/02/202011/02/2020
82020/0712/02/202018/02/2020
92020/0819/02/202025/02/2020
102020/0926/02/202003/03/2020
112020/1004/03/202010/03/2020
12
Lookup
Cell Formulas
RangeFormula
E4E4=XLOOKUP(E3,B2:B11,A2:A11,"",-1)
 
Upvote 0
Hi WashingtonDC74,

Try:

Book1
ABCDEF
1WeekStart DateEnd DateInput=17-Jan-20
22020/0101-Jan-2007-Jan-20Output=2020/03
32020/0208-Jan-2014-Jan-20
42020/0315-Jan-2021-Jan-20
52020/0422-Jan-2028-Jan-20
62020/0529-Jan-2004-Feb-20
72020/0605-Feb-2011-Feb-20
82020/0712-Feb-2018-Feb-20
92020/0819-Feb-2025-Feb-20
102020/0926-Feb-2003-Mar-20
112020/1004-Mar-2010-Mar-20
Sheet1
Cell Formulas
RangeFormula
F2F2=INDEX($A$2:$A$11,MATCH(1,INDEX(($F$1>=$B$2:$B$11)*($F$1<=$C$2:$C$11),,),0))
 
Upvote 0
Awesome! Many thanks!
I dont be boring but you can quicly summarize why you chosen -1 as match model ? Why you didnt pickup 1 as match model instead of?
 
Upvote 0
It is 1 and not -1.
It's looking for a logical 1 when checking $F$1>=$B$2:$B$11 and $F$1<=$C$2:$C$11

EDIT: Oops! I didn't see @Fluff had already posted an alternative.
 
Upvote 0
It is 1 and not -1.
It's looking for a logical 1 when checking $F$1>=$B$2:$B$11 and $F$1<=$C$2:$C$11
Sorry my reply was destined to Fluff...

By the way, many thanks for your help!
I tried to mix Index and match formulas but I didnt multiply $F$1<=$C$2:$C$11...
That's make logical now

Thanks!

BR
 
Upvote 0
The -1 tells the formula to find "an exact match or next smaller" so as it cannot find 17th Jan it gets the next smaller value which is 15th Jan.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,276
Members
449,075
Latest member
staticfluids

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