[英]Doing a reverse MATCH lookup in Excel
I have two tables. 我有两张桌子。
Data
and GroupLookup
Data
和组GroupLookup
Data
contains Two fields Text
and Group
, GroupLookup contains LookupValue
and Group
Data
包含两个字段Text
和Group
,GroupLookup包含LookupValue
和Group
The idea is i wan't to use a formula for Data[Group]
to find in Data[@Text]
ie a row, a wildcard word from GroupLookup[LookupValue]
and get GroupLookup[Group]
into Data[Group]
我的想法是我不会使用
Data[Group]
的公式在Data[@Text]
查找,即一行,来自GroupLookup[LookupValue]
的通配符, GroupLookup[LookupValue]
GroupLookup[Group]
放入Data[Group]
For example i have a text called "Banjo Pizza 1231" in my Data[Text]
i want to lookup "pizza" and then apply the GroupLookup[Group]
whos value would be "Pizza Expense". 例如,我在
Data[Text]
有一个名为“ Banjo Pizza 1231”的Data[Text]
我想查找“ pizza”,然后应用GroupLookup[Group]
值为“ Pizza Expense”。
I've tried a formula like 我尝试过一个像
=INDEX(GroupLookup[Group];MATCH("*"&[@Text]&"*";GroupLookup[LookupValue];0))
But it do it the wrong way. 但这是错误的方式。 It applies the Text to the LookupValue.
它将文本应用于LookupValue。 Eg "BC" in Text would match "ABC" in LookupValue.
例如,文本中的“ BC”将与LookupValue中的“ ABC”匹配。 I want it the otherway around.
我反过来想要它。
Please bear with my ASCII-art table: 请忍受我的ASCII艺术表:
A B C D E
1 **Data** **GroupLookup**
2 Text Group LookupValue Group
3 Banjo Pizza 123 Pizza Expense Pizza Pizza Expense
4 CrabbyPatty Burger Burger Expense Burger Burger Expense
5 Fries Work Fries Expense Fries Fries Expense
6 Softdrinkersss SoftDrinks Expense Softdrink SoftDrinks Expense
7 Pizzaderia Pizza Expense
8 OverloadedFries Fries Expense
9 Coco Koala Softdrinks SoftDrinks Expense
Let's assume that the above data is your DataSheet, (with "A to E" as your column head and "1 to 9" is your row number) You should have a minimal data in the GroupLookup since it is your "Group". 让我们假设上面的数据是您的DataSheet((以“ A到E”作为您的列标题,而“ 1到9”是您的行号)您在GroupLookup中应该有最少的数据,因为它是您的“组”。 In my sample, I had grouped 5 categories in my "GroupLookup": Pizza, Burger, Fries, & Softdrink.
在我的示例中,我在“ GroupLookup”中将5个类别分组:披萨,汉堡,薯条和软饮料。
Then I will Lookup those value in my Data[Text] column using the below formula in Data[Group] column. 然后,我将使用Data [Group]列中的以下公式在Data [Text]列中查找这些值。
=IF(IFERROR(MATCH("*"&$E$3&"*",A3,0),"False"),INDEX($E$3:$F$6,1,2),IF(IFERROR(MATCH("*"&$E$4&"*",A3,0),"False"),INDEX($E$3:$F$6,2,2),IF(IFERROR(MATCH("*"&$E$5&"*",A3,0),"False"),INDEX($E$3:$F$6,3,2),IF(IFERROR(MATCH("*"&$E$6&"*",A3,0),"False"),INDEX($E$3:$F$6,4,2)))))
If the word Pizza is present in my Data[text] column, my Data[Group] column will get it's value from GroupLookup[Group] which is "Pizza Expense"; 如果我的Data [text]列中有Pizza一词,则我的Data [Group]列将从GroupLookup [Group]中获取它的值,即“ Pizza Expense”; same logic with the other LookupValue.
与其他LookupValue相同的逻辑。
Hope this helps. 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.