Xlookup with offset or minifs?

LW2016

New Member
Joined
Jun 4, 2020
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have been struggling with this formula for two days. Below is a sample of my data. I am trying to return the # of Accts in the first non-blank cell for Dec 2019 # Accts and May 2021 # Accts where that value is not greater than Enroll Month Start.

12/1/2019​
1/1/2020​
2/1/2020​
3/1/2020​
4/1/2020​
5/1/2020​
6/1/2020​
7/1/2020​
8/1/2020​
9/1/2020​
10/1/2020​
11/1/2020​
12/1/2020​
1/1/2021​
2/1/2021​
3/1/2021​
4/1/2021​
5/1/2021​
DealerEnrollment DateEnroll Month StartDec 2019 # AcctsJan 2020 # AcctsFeb 2020 # AcctsMar 2020 # AcctsApr 2020 # AcctsMay 2020 # AcctsJun 2020 # AcctsJul 2020 # AcctsAug 2020 # AcctsSep 2020 # AcctsOct 2020 # AcctsNov 2020 # AcctsDec 2020 # AcctsJan 2021 # AcctsFeb 2021 # AcctsMar 2021 # AcctsApr 2021 # AcctsMay 2021 # Accts
99991053​
5/5/2021​
5/1/2021​
6094​
6565​
6644​
6707​
6821​
6859​
6,918
99996962​
1/1/2099​
1/1/2099​
107​
261​
324​
886​
2136​
4001​
5512​
6,495
99991060​
12/2/2020​
12/1/2020​
2292​
2236​
2201​
2169​
2157​
2168​
2160​
2158​
2,143
99990869​
11/25/2020​
11/1/2020​
1935​
1921​
1916​
1910​
1901​
1889​
1877​
1877​
1866​
1854​
1841​
1837​
1827​
1825​
1,821
99990251​
2/17/2021​
2/1/2021​
1786​
1781​
1783​
1,784
99991050​
12/6/2020​
12/1/2020​
2​
7​
7​
7​
25​
1539​
1535​
1541​
1552​
1,550
99990823​
6/9/2020​
6/1/2020​
1,410
1411​
1415​
1412​
1417​
1421​
1419​
1421​
1422​
1429​
1419​
1417​
1426​
1427​
1434​
1,424
99990603​
3/12/2020​
3/1/2020​
1123​
1115​
1124​
1125​
1125​
1122​
1118​
1125​
1116​
1116​
1112​
1113​
1118​
1112​
1,116
99995041​
9/29/2020​
9/1/2020​
742​
740​
739​
740​
737​
737​
746​
750​
752​
751​
753​
751​
745​
744
99990844​
9/9/2020​
9/1/2020​
686
697​
711​
717​
725​
736​
741​
739​
737​
745​
735​
742​
745​
744​
743​
742
99990894​
12/6/2020​
12/1/2020​
1​
1​
5​
5​
5​
6​
18​
29​
29​
34​
49​
693​
693
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Welcome to the MrExcel forum!

I had a hard time trying to understand your request , but see if this is what you want:

Book1
BCDEFGHIJKLMNOPQRSTUVW
112/1/20191/1/20202/1/20203/1/20204/1/20205/1/20206/1/20207/1/20208/1/20209/1/202010/1/202011/1/202012/1/20201/1/20212/1/20213/1/20214/1/20215/1/2021First non-blank cell
2Enrollment DateEnroll Month Start
35/5/20215/1/202160946565664467076821685969186094
41/1/20991/1/20991072613248862136400155126495107
512/2/202012/1/20202292223622012169215721682160215821432292
Sheet30
Cell Formulas
RangeFormula
W3:W5W3=INDEX(FILTER(D3:U3,(D3:U3>0)*(D$1:U$1<C3)),1)


If not, please put in the expected results for your formula. And if you could use the XL2BB tool to display your sheet, that would be most helpful. It would keep me from having to retype all your data. Check the link in my signature or the reply box. It's easy to download, install, and use.
 
Upvote 0
Welcome to the MrExcel forum!

I had a hard time trying to understand your request , but see if this is what you want:

Book1
BCDEFGHIJKLMNOPQRSTUVW
112/1/20191/1/20202/1/20203/1/20204/1/20205/1/20206/1/20207/1/20208/1/20209/1/202010/1/202011/1/202012/1/20201/1/20212/1/20213/1/20214/1/20215/1/2021First non-blank cell
2Enrollment DateEnroll Month Start
35/5/20215/1/202160946565664467076821685969186094
41/1/20991/1/20991072613248862136400155126495107
512/2/202012/1/20202292223622012169215721682160215821432292
Sheet30
Cell Formulas
RangeFormula
W3:W5W3=INDEX(FILTER(D3:U3,(D3:U3>0)*(D$1:U$1<C3)),1)


If not, please put in the expected results for your formula. And if you could use the XL2BB tool to display your sheet, that would be most helpful. It would keep me from having to retype all your data. Check the link in my signature or the reply box. It's easy to download, install, and use.
Hi, thanks for your reply. It is close, but if there is no data before the Enroll Month Start, I want to return #N/A. Here is the sheet using the XL2BB tool w/ expected results in column X.
Book2
ABCDEFGHIJKLMNOPQRSTUVWXYZAAAB
2DealerEnrollment DateEnroll Month Start Dec 2019 # Accts Jan 2020 # Accts Feb 2020 # Accts Mar 2020 # AcctsApr 2020 # Accts May 2020 # Accts Jun 2020 # Accts Jul 2020 # Accts Aug 2020 # Accts Sep 2020 # Accts Oct 2020 # Accts Nov 2020 # Accts Dec 2020 # Accts Jan 2021 # Accts Feb 2021 # Accts Mar 2021 # Accts Apr 2021 # Accts May 2021 # Accts last month before enroll or last value in row first value in row Expected results: first value in row before enrollment date
3999910535/5/20215/1/20216094656566446707682168596,9186,8596,0946,094
4999969621/1/20991/1/20991072613248862136400155126,495 107107
59999106012/2/202012/1/2020229222362201216921572168216021582,1432,2012,2922,292
69999086911/25/202011/1/2020193519211916191019011889187718771866185418411837182718251,8211,8771,9351,935
7999902512/17/20212/1/20211786178117831,7841,7861,786#N/Athere is no value < Enroll Month Start
89999105012/6/202012/1/202027772515391535154115521,550722
9999908236/9/20206/1/20201,410141114151412141714211419142114221429141914171426142714341,4241,4121,4101,410
10999906033/12/20203/1/2020112311151124112511251122111811251116111611121113111811121,1161,1231,123#N/Athere is no value < Enroll Month Start
11999950419/29/20209/1/2020742740739740737737746750752751753751745744737742742
Sheet1
 
Upvote 0
Try this modification

Excel Formula:
=INDEX(FILTER(D3:U3,(D3:U3>0)*(D$1:U$1<C3),NA()),1)
 
Upvote 0
Solution
Glad we could help! Thanks for the feedback. :biggrin:

Come back anytime, there's a wealth of information here, and lots of eager helpers.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,858
Members
449,051
Latest member
excelquestion515

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