Index/Match- 如果第一个值为空,则查找第二个值
Index/Match- Lookup 2nd Value if 1st Value is Blank
我希望在 excel 中编写公式时得到一些帮助。
我有一个 table,其中包含员工列表和他们的手机号码 phone。但是,table 的结构使得存在许多空白行和重复行。
本质上,我希望通过对相应的单元格 phone 数字执行查找来创建一个没有任何重复项和空白的新 table。
问题是,当我执行标准 Index/Match 公式时,该公式将只获取第一个查找值,这通常是一个空白行。
我该如何修改这个公式来表达类似 "Look this value up. If the value is blank, lookup the second value" 的内容?
这是 table 的示例:
Table 1 (Original)
+---------------+--------------+
| Employee Name | Cell Phone |
+---------------+--------------+
| Doe, John | |
| Doe, John | 111-111-1111 |
| Smith, Eric | 222-222-2222 |
| Jones, Dave | |
| Jones, Dave | 333-333-3333 |
+---------------+--------------+
Table 2 (What I want the table to look like)
+---------------+--------------+
| Employee Name | Cell Phone |
+---------------+--------------+
| Doe, John | 111-111-1111 |
| Smith, Eric | 222-222-2222 |
| Jones, Dave | 333-333-3333 |
+---------------+--------------+
=Index(Table1[Cell Phone], Match([Employee Name], Table1[Employee Name],0))
第一个非空白匹配如何?
=INDEX(B:B, AGGREGATE(15, 6, ROW(:9)/((A:A9=F2)*(B:B9<>"")), 1))
'listobject table alternative
=INDEX(Table1[Cell Phone], AGGREGATE(15, 6, (ROW(Table1[Cell Phone])-ROW(Table1[#Headers]))/((Table1[Employee Name]=F7)*(Table1[Cell Phone]<>"")), 1))
我希望在 excel 中编写公式时得到一些帮助。 我有一个 table,其中包含员工列表和他们的手机号码 phone。但是,table 的结构使得存在许多空白行和重复行。
本质上,我希望通过对相应的单元格 phone 数字执行查找来创建一个没有任何重复项和空白的新 table。
问题是,当我执行标准 Index/Match 公式时,该公式将只获取第一个查找值,这通常是一个空白行。
我该如何修改这个公式来表达类似 "Look this value up. If the value is blank, lookup the second value" 的内容?
这是 table 的示例:
Table 1 (Original)
+---------------+--------------+
| Employee Name | Cell Phone |
+---------------+--------------+
| Doe, John | |
| Doe, John | 111-111-1111 |
| Smith, Eric | 222-222-2222 |
| Jones, Dave | |
| Jones, Dave | 333-333-3333 |
+---------------+--------------+
Table 2 (What I want the table to look like)
+---------------+--------------+
| Employee Name | Cell Phone |
+---------------+--------------+
| Doe, John | 111-111-1111 |
| Smith, Eric | 222-222-2222 |
| Jones, Dave | 333-333-3333 |
+---------------+--------------+
=Index(Table1[Cell Phone], Match([Employee Name], Table1[Employee Name],0))
第一个非空白匹配如何?
=INDEX(B:B, AGGREGATE(15, 6, ROW(:9)/((A:A9=F2)*(B:B9<>"")), 1))
'listobject table alternative
=INDEX(Table1[Cell Phone], AGGREGATE(15, 6, (ROW(Table1[Cell Phone])-ROW(Table1[#Headers]))/((Table1[Employee Name]=F7)*(Table1[Cell Phone]<>"")), 1))