Oct 25 2022 08:39 AM - edited Oct 25 2022 01:02 PM
i am trying to find a formula to would allow me to search an array and find the data matches the data from another array. for instance my Array A is formatted like
EE01123
EEM02123
EE10123
and Array B is like
01
02
so i want to look at the first 2 numbers of array A and if they match options in array B then add to list. If it makes a difference i am only looking for the first 5 matches.
if it is easier i can use a macro to make this work.
i am using EXCEL 2019 on windows.
TIA
Oct 25 2022 10:37 AM
@heljarreHi Jarred, unfortunately you didn't tell me which Excel version you are working with. I have built a function that only works with Excel 365 or Excel for the Web, because very new functions like BYROW() are used. I hope I have understood your task correctly.
=LET(
areaA,A1:A3,
areaB,E1:E2,
maxle, MAX(LEN(areaA)),
fitwnu,BYROW(areaA,LAMBDA(in,MID(in,MIN(IFERROR((VALUE(MID(in,SEQUENCE(1,maxle),1))>=0)*SEQUENCE(1,maxle),"")),2))),
FILTER(areaA,MMULT(--(fitwnu=TRANSPOSE(areaB)),SEQUENCE(COUNTA(areaB)))>0))
Oct 25 2022 11:03 AM
Oct 25 2022 01:36 PM
Without dynamic arrays, your best option may be to extract the number portion of the string first with flash fill (Type in the desired return for the first item, press enter, then press ctrl+E). Then you can run INDEX-MATCH off the cleaned up numbers:
Oct 25 2022 01:59 PM
Oct 25 2022 02:04 PM