如何在 Excel 中创建一个公式,用于搜索一列(外部工作表)中的值和另一列(同一外部工作表)中的另一个值

发布于 2025-01-14 21:21:03 字数 1456 浏览 1 评论 0原文

我有两张 Excel 工作表,需要查看其中一张(较小)中的项目是否已包含在另一张中。

问题:列不一样。有些是,但不是全部,索引项目是重复的(客户)。

我想使用(例如)“客户”和“发票#”作为索引,因为这些项目都在两个工作表中,并在工作表 02 中搜索“发票编号”和“金额”,然后返回到工作表 01,比较“金额”。

示例:

表 1

客户发票金额Sheet2 的发票金额发票确认金额确认
Paul45$345$3450匹配不匹配
Peter139$265$2.65匹配不匹配
Paul425$345$345匹配匹配
彼得279$5.265$5.265.000匹配不匹配

1.000 行

表 2

客户发票金额
Paul45$3450
Peter139$2.65
Paul425$345
Cesar478$7.345
Peter279$5.265。 000

234k 行

I have two Excel sheets and need to see if items in one of them (smaller) are already included at the other.

Problem: columns are not the same. Some are, but not all, and indexed items are duplicated (customers).

I´d like to use (for example) "customer" and "invoice #" as index, because these items are in both sheets, and search for "invoice number" and "amount" in sheet 02, and return to sheet 01, to compare "amount".

Example:

Sheet 1

CustomerInvoiceAmountAmount for sheet2Invoice ConfirmationAmount confirmation
Paul45$345$3450matchnot match
Peter139$265$2.65matchnot match
Paul425$345$345matchmatch
Peter279$5.265$5.265.000matchnot match

1.000 lines

Sheet 2

CustomerInvoiceAmount
Paul45$3450
Peter139$2.65
Paul425$345
Cesar478$7.345
Peter279$5.265.000

234k lines

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一身软味 2025-01-21 21:21:03

您可以使用 INDEX & 尝试以下操作: MATCH 函数,或者如果您使用 O365,则使用带有 布尔 逻辑的 XLOOKUP 函数

• 单元格 D3 中使用的公式 - 2 种方式,

Approach_One -->输入公式后确认输入 CTRL + SHIFT + ENTER 而不是仅 ENTER,因为它是数组公式

=INDEX($C$10:$C$14,MATCH(1,(A3=$A$10:$A$14)*(B3=$B$10:$B$14),0))

< strong>Approach_Two

=XLOOKUP(1,(A3=$A$10:$A$14)*(B3=$B$10:$B$14),$C$10:$C$14)

• 单元格 E3 中使用的公式 - 2 种方式,

Approach_One

=IF(ISNUMBER(MATCH(1,(A3=$A$10:$A$14)*(B3=$B$10:$B$14),0)),"Match","Not Match")

Approach_Two

=IF(XLOOKUP(1,(A3=$A$10:$A$14)*(B3=$B$10:$B$14),$B$10:$B$14)=B3,"Match","Not Match")

• 单元格 F3< 中使用的公式/strong> - 2种方式,

Approach_One

=IF(D3=C3,"Match","Not Match")

Approach_Two

=(D3=C3)*1

自定义格式为 -->选择范围-->按 CTRL + 1 -->设置单元格格式对话框 -->数字选项卡 -->类别-->定制-->输入以下内容 -->

[=1]"Match";[=0]"Not Match";

使用布尔逻辑是一种更灵活的方法,因为可以根据需要调整语法以使用其他逻辑运算符和其他函数。

FORMULA_SOLUTION

Here is what you can try, using INDEX & MATCH Function or if you are using O365 then use XLOOKUP Function with Boolean Logic

• Formula used in cell D3 - 2 ways,

Approach_One --> Confirm enter CTRL + SHIFT + ENTER instead of just ENTER after entering the formula, since its an array formula

=INDEX($C$10:$C$14,MATCH(1,(A3=$A$10:$A$14)*(B3=$B$10:$B$14),0))

Approach_Two

=XLOOKUP(1,(A3=$A$10:$A$14)*(B3=$B$10:$B$14),$C$10:$C$14)

• Formula used in cell E3 - 2 ways,

Approach_One

=IF(ISNUMBER(MATCH(1,(A3=$A$10:$A$14)*(B3=$B$10:$B$14),0)),"Match","Not Match")

Approach_Two

=IF(XLOOKUP(1,(A3=$A$10:$A$14)*(B3=$B$10:$B$14),$B$10:$B$14)=B3,"Match","Not Match")

• Formula used in cell F3 - 2 ways,

Approach_One

=IF(D3=C3,"Match","Not Match")

Approach_Two

=(D3=C3)*1

And Custom Format as --> Select the range --> Press CTRL + 1 --> Format cells Dialog --> Number Tab --> Category --> Custom --> Type the below -->

[=1]"Match";[=0]"Not Match";

Using of Boolean Logic is a more flexible approach since the syntax can be adjusted to use other logical operators and other functions as needed.

FORMULA_SOLUTION

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文