【问题标题】:How to restrict duplicate data entry如何限制重复数据输入
【发布时间】:2014-06-12 08:37:08
【问题描述】:

我希望为我的客户创建条件格式:

这将是我的数据:

     A           B
1: Name Ticket Number
2: Jack         123
3: Jack         123
4: Jack         123
5: Kimberly     456
6: Kimberly     123
7: Kimberly     456
8: Kurt         456
9: Kurt         587
10: Jack        123

我希望为名为 Jack 的特定客户创建条件格式。

例如,

  1. 如果 Jack 的票号为 123,则该票号不能在其他客户上重复。如果其他客户使用相同的票号,则会突出显示指定的客户。

  2. 对于其他客户,Kurt 和 Kimberly 或其他新进入客户,他们的票号可以重复使用。

  3. 一旦特定客户 Jack 出现在顶部,票号将不再重复。例如在B10中,票号应与其他与top Jack的票号和其他客户票号不同的号码键入。它应该是一个唯一的数字,如 789。如果重复,则单元格将突出显示。

这将是我希望它看起来像的示例:

     A           B
1: Name Ticket Number
2: Jack         123      -> will not be highlighted
3: Jack         123      -> will not be highlighted
4: Jack         123      -> will not be highlighted
5: Kimberly     456      -> will not be highlighted because it doesn't contain the same ticket number with Jack|123
6: Kimberly     123      -> this will be highlighted because it contain same ticket number with Jack|123 
7: Kimberly     456      -> will not be highlighted because it doesn't contain the same ticket number with Jack|123 
8: Kurt         456      -> will not be highlighted because it doesn't contain the same ticket number with Jack|123 and Kurt can share the same ticket number with Kimberly or others customers besides than Jack
9: Kurt         587      -> will not be highlighted because it doesn't contain the same ticket number with Jack|123 
10: Jack        123      -> will be highlighted because ticket number 123 is appear on the top of the list(B2:B4), it should contain a new ticket number after few customer have being insert after Jack on B2:B4
11: Jack        789      -> will not be highlighted because it doesn't contain the same ticket number with Jack on B2:B4 after few customer being insert in the middle and ticket number 789 is different with others customer as well.

谢谢。

【问题讨论】:

  • no.1 和 2 都可以。但我不确定 3 号。

标签: excel excel-formula excel-2010


【解决方案1】:

如评论所述,以下公式将突出显示与 Jack 持有任何票号的任何客户。

=IF($A2<>"JACK",IF(ISERROR(MATCH($B2,IF($A$2:A$11="JACK",$B$2:B$11,""),0)),FALSE,TRUE))

【讨论】:

  • @pnuts 在他的第一篇文章中,我想我读到他/她想突出显示这个名字。但无论如何,我的回答只能部分满足 OP 的要求。所以这并不能真正完全回答这个问题。我只是发布它以防 OP 需要它:)。如果有完整的答案,我会删除它。 :)
猜你喜欢
  • 2021-08-10
  • 2018-12-30
  • 1970-01-01
  • 2020-08-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多