• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

A1 format red if column C & D do not match in every row

Leaving cell A1 blank.  Formula handled within the format formula section.

Thank you,
JP aaa A1-red-if-C-and-D-rows-do-not-al.xlsx
0
easycapital
Asked:
easycapital
1 Solution
 
nutschCommented:
Use the following conditional formatting rule

=SUMPRODUCT((C:C=D:D)*1)<>SUMPRODUCT((C:C=C:C)*1)

Thomas
0
 
SANTABABYCommented:
1.  Select the A cell of any row which you want to show the color.
(assuming that you selected row 4, i.e. cell A4, do the following.

2.  choose "Conditional Formatting" from "Format" menu

3. Select "Formula Is" in the condition dropdown list

4. Enter the following formula in the text field.
=OFFSET(A4,0,2)<>OFFSET(A4,0,3)

5. Click the format button and choose the format (Red)

6. OK and exit.

7. Copy cell A4 and select all the cells in the column A where you want to apply the formula.

8. Paste Special and choose "Format" only.

9. You are done.
0
 
easycapitalAuthor Commented:
Excelente
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
easycapitalAuthor Commented:
Sorry Santababy. I missed your solution.  Thank you for the feedback.
//JP
0
 
Saqib Husain, SyedEngineerCommented:
=SUMPRODUCT($C$4:$C$9-$D$4:$D$9)
0
 
easycapitalAuthor Commented:
Nutsch, not sure why SUMPRODUCT((C:C=D:D) and not C:C=C:C.
Also, the multiplying by 1 is to ensure they are all treated as numbers?

ssagibh. not understanding how subtracting, ensures that every row is the identical.

Thanks,
Juan
0
 
Saqib Husain, SyedEngineerCommented:
Does it work or does it not work?
0
 
easycapitalAuthor Commented:
Yes it works.  I am just trying to understand the logic, as per my last comment.
0
 
Saqib Husain, SyedEngineerCommented:
Actually this might work in most cases.

The value of false is zero and the value of true is 1. I played with this and if all the numbers are equal their difference would be zero and their sum would be zero.

This, however, may fail in cases where, for example, c4 is 4 and d4 is 3 and then c5 is 3 and d5 is 4 and all the rest are the same. In this case the difference in row 4 would be 1 and the difference in row 5 would be -1 and summing all up would again give zero.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now