Dynamic Lookup Array

DaveyP

New Member
Joined
Jan 13, 2022
Messages
5
Office Version
  1. 2021
Platform
  1. Windows
I am trying to sum stock dividends between two dates.
I have created an XLOOKUP formula that does this based on inputting the stock symbol, however the Lookup array remains the same which means the result is inaccurate.
I have attached an image of my progress so far. Any help in creating a Dynamic Lookup Array would be appreciated, I want to avoid any volatile functions as my workbook is already quite large. Thx.
 

Attachments

  • XLOOKUP arrrays.JPG
    XLOOKUP arrrays.JPG
    166.5 KB · Views: 23

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi & welcome to MrExcel.
How about
Excel Formula:
=LET(f,FILTER(B1:G23,LEFT(B1:G1,3)=J6),SUM(FILTER(INDEX(f,,2),(INDEX(f,,1)>=J5)*(INDEX(f,,1)<=J4))))
 
Upvote 0
Thank you very much for your reply, your solution works perfectly with the data I provided to you. Unfortunately, stock symbols are not all just 3 letters in length, my apologies for not considering this fact when I posted the request for assistance. The revised attachment shows what happened when I changed the symbols to: 1) a single letter 2) an .F suffix. Thanks again, next time I will try to use the XL2BB, which I admit I had never heard of until today.
 

Attachments

  • LET_FILTER arrrays.JPG
    LET_FILTER arrrays.JPG
    150.3 KB · Views: 9
Upvote 0
This will only work in MS 365.

20220114 Sum Filter Lookup 2 dimensions.xlsx
ABCDEFGHIJKL
1A_DatesAAQN_datesAQNZPAY.F_datesZPAY.F
2202112300.21202112140.88202112290.12
3202109280.21202109140.88202111260.1
4202106290.21202106140.88202110270.1Current Date202201132022011320220113
5202103300.19202103120.88202109280.1Sum from Date202009292020092920200929
6202012300.19202012140.83202108270.1StockAAQNZPAY.F
7202009290.19202009140.83202107280.1Stock_Dates
8202006290.19202006120.83202106280.1
9202003300.18202003130.83202105260.11.24.351.52
10202104280.1
11202103290.1
12202102240.1
13202101270.1
14202012290.1
15202011270.1
16202010280.1
17202009280.1
18202008270.1
19
Sheet1
Cell Formulas
RangeFormula
J9:L9J9=LET(dtcol,INDEX($B$2:$G$18,0,MATCH(J$6,$B$1:$G$1,0)-1), divdcol,INDEX($B$2:$G$18,0,MATCH(J$6,$B$1:$G$1,0)), SUM(FILTER(divdcol,(dtcol>=J$5)*(dtcol<=J$4),"")))
 
Upvote 0
Another option
Excel Formula:
=LET(f,FILTER(B2:G23,LEFT(B1:G1,FIND("_",B1:G1&"_")-1)=J6),SUM(FILTER(INDEX(f,,2),(INDEX(f,,1)>=J5)*(INDEX(f,,1)<=J4))))
 
Upvote 0
Thank you very much to both of you, both solutions work great!
I had been using 2019 on my PC, but I have recently been experimenting using the online version of Excel to see if the XLOOKUP/XMATCH functions would do what I was trying to accomplish. Now that you both have opened my eyes to LET & FILTER, I can see that they are more powerful alternatives.
Time for me to upgrade. Thanks again for your solutions and for the introduction to LET & FILTER.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,542
Members
449,316
Latest member
sravya

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