简体   繁体   中英

Excel multiple criteria match with partial strings using formulas

I have some data that I would like to assign a description based on the partial strings as those can come with partial and different names. Below is an example of the column I need to add a description next to based on the partial match:

PRODUCT
ARK-78787
7878ARK-7555
BEL*EEER44
eerBEL*/*
fdseebel***

and I have a table like this for the description

Category A  ARK,BAR,CER
Category B  BEL,CEL,DEL

I need to match those multiple strings while checking the partial match but have no luck so far. The formula I'm using is:

=INDEX(F:F,AGGREGATE(15,7,ROW($G$3:$I$3)/(ISNUMBER(SEARCH($G$2:$I$2,B2))),1))

Attaching a Google Sheets file as a reference to have a better picture of this

https://docs.google.com/spreadsheets/d/1QuJ695jd4fcZrVdjHEFZa9T7F5c1Ky2xCCzspu8FAiw/edit?usp=sharing

Any thoughts?

Enter the formula in D2 as an array formula and drag it down

=INDEX($H$1:$H$5,MAX((ROW($I$2:$K$5)*ISNUMBER(SEARCH($I$2:$K$5,A2)))))

Based on the provided non-array-formula and sample data, the final formula would look like

=INDEX($H$1:$H$5,AGGREGATE(15,7,(ROW($I$2:$K$5))/(ISNUMBER(SEARCH($I$2:$K$5,A2))),1))

EDIT: set ranges according to the answer of @usmanhaq.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM