[英]Highlight rows where the same values in columns A:B but different values in column C
I have 4000+ rows of data need to be working on.我有 4000 多行数据需要处理。 Where column A represents the SKU, column B represents the unit and column C represents the Unit Price.
其中A列代表SKU,B列代表单位,C列代表单价。 The same SKU, Unit and Unit Price may duplicate at their own columns as shown as the picture attached.
相同的 SKU、单位和单价可能会在它们自己的列中重复,如所附图片所示。 I need to check and highlight whether which SKU, appears to have different Unit Price but with same Unit.
我需要检查并突出显示哪个 SKU 似乎具有不同的单价但具有相同的单位。 Which mean same SKU (Column A), same Unit (Column B) but different in Unit Price (Column C).
这意味着相同的 SKU(A 列),相同的单位(B 列)但单价不同(C 列)。
Is there any possible method or formula for doing this checking instead of checking row-by-row manually?是否有任何可能的方法或公式来进行此检查而不是手动逐行检查?
[ [
How to I find the same cases just like row 4 in the picture (with same SKU, same Unit but different Unit Price?如何找到与图片中第4行相同的案例(具有相同的SKU,相同的单位但不同的单价?
You can design a Conditional Formatting rule using a formula based on the COUNTIFS function .您可以使用基于COUNTIFS 函数的公式设计条件格式规则。 If you set a rule such that there must be at least two other rows with the same SKU and Unit combination but with different Unit Prices then a formula can be easily derived.
如果您设置的规则必须至少有两行具有相同的 SKU 和单位组合但具有不同的单位价格,则可以轻松推导出公式。
First, select all of columns A:C then go to Home ► Styles ► Conditional Formatting ► New Rule.首先,选择 A:C 的所有列,然后转到主页 ► 样式 ► 条件格式 ► 新规则。 Opt for Use a formula to determine which cells to format and supply the following for the Format values where this formula is true: text box.
选择使用公式来确定要设置格式的单元格,并为该公式为真的格式值提供以下内容:文本框。
=AND(ROW(A1)>1, COUNTIFS($A:$A, $A1, $B:$B, $B1, $C:$C, "<>"&$C1)>1)
Click Format and apply some formatting the OK to accept the formatting and OK again to create the new rule.单击“格式”并应用一些格式,然后单击“确定”接受格式并再次“确定”以创建新规则。 Your results should resemble the following.
您的结果应类似于以下内容。
Note that I've added one more row of data to the sample data.请注意,我在示例数据中又添加了一行数据。
With sorting by ColumnA, then Column B then Column C and assuming a reasonably up-to-date version of Excel, please select ColumnsA:C and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true: :通过按 ColumnA 排序,然后是 B 列,然后是 C 列并假设 Excel 的合理最新版本,请选择 ColumnsA:C 和 HOME > 样式 - 条件格式,新规则...,使用公式来确定哪些单元格在此公式为真的情况下格式化和格式化值::
=AND($A1048576=$A1,$B1048576=$B1,$C1048576<>$C1)
Format... , select your choice of formatting (red), OK, OK.格式... ,选择您选择的格式(红色),确定,确定。
This is a version of =AND(A2=A3,B2=B3,C2<>C3)
(which follows how you expressed the problem) adapted to simplify the range selection ( Applies to
).这是
=AND(A2=A3,B2=B3,C2<>C3)
(遵循您表达问题的方式)的一个版本,适用于简化范围选择( Applies to
)。
The sorting is important because this looks for the first change in Unit Price
since a preceding Unit Price
for the same SKU
/ Unit
pair, consistent with your choice not to highlight [A123,5,25] though 25
is as different from 30
as 30
is from 25
!排序是重要的,因为这会在第一个变化
Unit Price
从先前的Unit Price
为同一SKU
/ Unit
对,您选择不亮[A123,5,25]一致,虽然25
是不同于30
为30
是从25
! In the image I have added some additional examples for illustration.在图像中,我添加了一些额外的例子来说明。
For sorting:对于排序:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.