【问题标题】:Excel Formula - Map Two Column values with Third ColumnExcel 公式 - 用第三列映射两列值
【发布时间】:2018-12-19 00:15:40
【问题描述】:

我在 excel 电子表格中有以下数据

customer_id  old_customer_id    parent_id
ACF00408     ALL02364           1819
ADA00856     ALT00420           1824
ALT00420                        1829
ALL02364     ADA00856           1834
ALL00523                        1839
AME02272     ACF00408           28921

如何映射列 customer_id 和 old_customer_id 以获取其相关的 parent_id,如下所示

例如,如果在customer_idold_customer_id 中都找到了ACF00408,那么它的parent_id 应该是28921 而不是1819

customer_id  parent_id
ACF00408     28921
ADA00856     1834
ALT00420     1824
ALL02364     1819
ALL00523     
AME02272

尝试使用 =VLOOKUP($A2, $B$2:$C$whatever, 2, 0) 但不起作用

【问题讨论】:

    标签: excel excel-formula


    【解决方案1】:

    您可以使用COUNTIF()Index/Match

    =IF(COUNTIF($A$2:$A$7,F2)+COUNTIF($B$2:$B$7,F2)=2,INDEX($C$2:$C$7,MATCH(F2,$B$2:$B$7,0)),"")
    

    【讨论】:

    • 你能详细说明我如何应用这个公式吗?我目前在我的 excel 中有三列。根据我掌握的数据,它将是=IF(COUNTIF($A$2:$A$3140,F1)+COUNTIF($B$2:$B$4853,F1)=2,INDEX($C$2:$C$5039,MATCH(F1,$B$2:$B$4853,0)),"")
    • @Slimshadddyyy - 范围应该都是相同的大小。因此,使用“最大”行号来设置所有内容。因此,用5039 替换每个范围中的最后一个行号,这应该可以工作......假设数据确实存在。
    猜你喜欢
    • 1970-01-01
    • 2020-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-13
    • 1970-01-01
    相关资源
    最近更新 更多