如果第一个值为空,则索引/匹配 - 查找第二个值

时间:2018-05-01 16:31:36

标签: excel excel-formula excel-2010

我希望在excel中编写一个公式得到一些帮助。 我有一张表,其中包含员工名单和手机号码。但是,该表的结构使得存在大量空白和重复的行。

基本上,我希望通过对相应的手机号码执行查找来创建一个没有任何重复和空白的新表。

问题是,当我做一个标准的索引/匹配公式时,公式将只抓取第一个查找值,这通常是一个空行。

如何修改此公式以表示类似的内容,"查看此值。如果该值为空,请查找第二个值"?

以下是表格的示例:

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))

1 个答案:

答案 0 :(得分:1)

第一次非空白比赛怎么样?

=INDEX(B:B, AGGREGATE(15, 6, ROW($2:$999)/((A$2:A$999=F2)*(B$2:B$999<>"")), 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))

enter image description here

相关问题