代码之家  ›  专栏  ›  技术社区  ›  Jonas Palačionis

检查excel中唯一值的值是否更改

  •  0
  • Jonas Palačionis  · 技术社区  · 5 年前

    我的excel看起来像这样:

    datestamp       page                revision    
    2020-02-10      www.google.com      43218     
    2020-02-10      www.yahoo.com       44476           
    2020-02-10      www.bing.com        42357       
    
    2020-02-11      www.google.com      43218   
    2020-02-11      www.google.com      43219     
    2020-02-11      www.yahoo.com       44477      
    2020-02-11      www.yahoo.com       44477   
    2020-02-11      www.bing.com        42358   
    2020-02-11      www.yahoo.com       44478
    

    我想核实一下 revision 更改/ page 并添加a TRUE , FALSE 值,使数据看起来像这样:

    datestamp       page                revision        changes
    2020-02-10      www.google.com      43218           FALSE ( because it's the first value and there is nothing to compare it with )
    2020-02-10      www.yahoo.com       44476           FALSE ( because it's the first value and there is nothing to compare it with )
    2020-02-10      www.bing.com        42357           FALSE ( because it's the first value and there is nothing to compare it with )
    
    2020-02-11      www.google.com      43218           FALSE ( because previous revision value for google.com is the same - 43218 )
    2020-02-11      www.google.com      43219           TRUE ( because previous revision value for google.com is different - 43218, and now its 43219 )
    2020-02-11      www.yahoo.com       44477           TRUE ( because previous revision value for yahoo.com is different - 44476, and now its 44477 )
    2020-02-11      www.yahoo.com       44477           FALSE ( because previous revision value for yahoo.com is the same - 44477 )
    2020-02-11      www.bing.com        42358           TRUE ( because previous revision value for bing.com is different - 42357, and now its 42358 )
    2020-02-11      www.yahoo.com       44478           TRUE ( because previous revision value for yahoo.com is different - 44477, and now its 44478 )
    

    我怎样才能做到这一点?谢谢你的建议。

    0 回复  |  直到 5 年前
        1
  •  1
  •   JvdV    5 年前

    In D2 ,尝试以下操作:

    =IF(C2<>"",IFERROR(LOOKUP(2,1/(B$1:B1=B2),C$1:C1)<>C2,FALSE),"")
    

    向下拖动。

    注: 初始 IF 是否可以根据您的示例数据检查空值。如果没有空单元格,就刮一下。


    Office 365-动态数组公式

    根据OP的评论,上述内容可能会返回 #SPILL! 错误。由于我个人无法访问这些功能,以下只是一个假设,如果有人能确认,那就太好了:

    取自 here :

    随着动态数组公式的出现,隐式交集有时不再起作用。自从 LOOKUP 正在丢弃 全部的 但在非动态数组公式中有一个值,在动态数组公式中将不再如此。Excel现在支持查找多个值,不再以静默方式执行隐式交集。如果没有足够的空间将值返回到网格,您将看到#SPILL错误。因此,我们需要用一种 @ :

    =IFERROR(@LOOKUP(2,1/(B$1:B1=B2),C$1:C1)<>C2,FALSE)
    

    在旧版本中(比如我的) @ 被接受,但由于隐式交集已就绪,因此被默默删除。