Google 用于将单个单元格中的数据与多个单元格中的数据进行比较的工作表公式,以及 return 基于这些单元格的值

Google Sheets formula to compare data in a single cell with multiple cells and return a value based on those cells

目前,我有 sheets 文档,该文档将包含姓氏字段的单元格名称与其他地方的一列数据进行比较,并在匹配时 returns 第三列的值。我在下面发布了一个例子

这是公式|||查找(A1,'Sheet 2'!B:B,'Column C'!C:C)

Sheet One with Formula              Sheet 2:
Column A    Column B                Column A    Column B    Column C
Smith       111111                  Oscar       Smith       111111

问题是如果有 2 个铁匠,它只会抓住第一个。

我想做的是使用首字母。 sheet 中的姓氏,并将 A 列和 B 列与 return C 列进行比较。

Sheet One with Formula              Sheet 2
Column A    Column B                Column A    Column B    Column C
O. Smith    111111                  Alex        Smith       222222
                                    Oscar       Smith       111111

我卡住了... 这里有一个link来帮忙。 https://docs.google.com/spreadsheets/d/1m087VIKk_F8OUbKy2wMvb12DM9fg9r0YIlbU24QHsSY/edit?usp=sharing

在Sheet1的B3中我输入了这个公式

=ArrayFormula(if(len(A3:A), vlookup(A3:A, {Left(Sheet2!A2:A)&". "&Sheet2!B2:B, Sheet2!C2:C}, 2, 0),))

看看这对你有用吗?

JPV 还告诉我 Lookup 要求内容按字母顺序排列。如果我使用 Vlookup,我可以使用我正在尝试的连接方法提取数据。

拼接公式:=Left(A2,1)&"."&B2

工作公式 - vlookup(A1,'Sheet 2'!B:B,'Column C'!C:C)

Sheet One with Formula      Sheet 2:
Column A    Column B        Column A    Column B    ColumnC     Column D
A. Smith    222222          Oscar       Smith       O.Smith     111111
                            Anthony     Smith       A. Smith    222222