在另一列上进行Excel部分匹配并分类

huangapple go评论63阅读模式
英文:

Excel Partial Match on Another Column and Categorize

问题

如何检查一个列中的单词是否包含另一列中的关键词,然后在Excel中进行分类?

我正在尝试对我的信用卡账单进行分类。

  1. 第一个Excel表格包含所有商店、供应商的交易清单,以及额外的关键词。
  2. 第二个Excel表格包含关键词和它们的分类。

尝试使用Vlookup、部分匹配,不太确定。每个月信用卡账单中可能有200笔交易,以及50个类别的查找。

资源如下。

Excel表格1:

信用卡描述 金额 类别(尝试填写)
商店亚马逊 25 设备
供应商麦当劳德克萨斯 4 食品
枫叶医生办公室 47 药品
翡翠面包店 9 食品

Excel表格2:

供应商 类别
亚马逊 设备
麦当劳 食品
医生 医疗
面包店 食品

资源:

https://www.automateexcel.com/formulas/vlookup-contains-partial-match/

英文:

How do I check if one word in a column contains keyword in another column, and then categorize using Excel?

I am trying to categorize my credit card statement.

  1. First Excel sheet has transaction list of all the stores, vendors, with extra keywords.
  2. Second Excel Sheet has keywords and their categories.

Trying to use Vlookup, partial matches, not sure. There could be 200 transactions in a credit card statement each month, and 50 categories lookup.

Resource below.

Excel Sheet 1:

Credit Card Description Amount Category (trying to fill in)
Store Amazon 25 Equipment
Vendor McDonalds TX 4 Food
Maple Doctor Office 47 Medicine
Emerald Bakery 9 Food

Excel Sheet 2:

Vendor Category
Amazon Equipment
McDonalds Food
Doctor Medical
Bakery Food

Resources:

https://www.automateexcel.com/formulas/vlookup-contains-partial-match/

答案1

得分: 2

Try FILTER() function with COUNTIFS().

=@FILTER($H$2:$H$5,COUNTIFS(A2,"*"& $G$2:$G$5 & "*"))

To fill down result automatically can use MAP() or BYROW(). Try-

=MAP(A2:A5,LAMBDA(x,FILTER(H2:H5,COUNTIFS(x,"*"& G2:G5 & "*")))

For Excel 2016:

=LOOKUP(,-FIND(" "&Sheet2!$A$2:$A$10&" "," "&A2&" "),Sheet2!$B$2:$B$10)

=IFERROR(INDEX($H$2:$H$5,AGGREGATE(15,6,ROW($1:$5)/(COUNTIFS(A2,"*"& $G$2:$G$5 & "*")),ROW($1:$1))),"")

英文:

Try FILTER() function with COUNTIFS().

=@FILTER($H$2:$H$5,COUNTIFS(A2,"*"& $G$2:$G$5 & "*"))

To fill down result automatically can use MAP() or BYROW(). Try-

=MAP(A2:A5,LAMBDA(x,FILTER(H2:H5,COUNTIFS(x,"*"& G2:G5 & "*"))))

在另一列上进行Excel部分匹配并分类

For Excel 2016:

=LOOKUP(,-FIND(" "&Sheet2!$A$2:$A$10&" "," "&A2&" "),Sheet2!$B$2:$B$10)

=IFERROR(INDEX($H$2:$H$5,AGGREGATE(15,6,ROW($1:$5)/(COUNTIFS(A2,"*"& $G$2:$G$5 & "*")),ROW($1:$1))),"")

huangapple
  • 本文由 发表于 2023年2月6日 05:22:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/75355607.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定