Puzzling results from Conditional Formatting rules & ranges

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,532
Office Version
  1. 365
Platform
  1. Windows
I am trying to construct a conditional formatting rule & range that will display an equal sign (=) whenever the data in a cell is equal to the data in the cell immediately above it.

In the table below, the data in D6:D13 is replicated in Columns E-H. All 4 columns have the identical data. In each of the Columns E-G, I applied the conditional formatting rules indicated in Row 3 over the ranges indicated in Row 4. Columns F & G have the correct results. Column E does not. I do not understand why not.

R/C
CDEFG
3RuleNone=E7=E6=F7=F6=G6=G5
4RangeNone
$E$6:$E$13
$F$7:$F$13$G$6:$G$13
5=D6=D5?0000
625=2525
72525==
830
303030
935=3535
1035===
113535==
1240=4040
134040==

<colgroup><col><col><col><col span="3"></colgroup><tbody>
</tbody>
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
With the formulae you have shown cols E&G are correct, but col F is not.
Are you sure that the formulae shown are what you are using?
 
Upvote 0
Upvote 0
I hadn't noticed that you are using different ranges, hence the different results.
That said the result in Col E is not incorrect.
If E7=E6 then E6 will be formatted as that is the first cell in the applies to range.
Whereas for Col F F7 is the first cell in the applies to range, hence F6 does not get formatted.
 
Upvote 0
I hadn't noticed that you are using different ranges, hence the different results.
That said the result in Col E is not incorrect.
If E7=E6 then E6 will be formatted as that is the first cell in the applies to range.
Whereas for Col F F7 is the first cell in the applies to range, hence F6 does not get formatted.
Yes, I know that the results in E are incorrect. The question is why?

Are you saying that the result of the first test, =E7=E6, is stored in E6 (not E7) because E6 is the first cell in the range?

If so, then as it moves through the range, the next test would be =E8=E7 (because both addresses are fully relative, right?) and that result would be stored in E7. Is that correct?

That seems to be what is happening.

So it really doesn't matter whether the rule is "=E7=E6" or "=E6=E7". Either way it will compare the same two cells and put the result in E6. Right?

Thanks for the help.
 
Upvote 0
Yes, I know that the results in E are incorrect. The question is why?
I actually said
That said the result in Col E is NOT incorrect.
Are you saying that the result of the first test, =E7=E6, is stored in E6 (not E7) because E6 is the first cell in the range?

If so, then as it moves through the range, the next test would be =E8=E7 (because both addresses are fully relative, right?) and that result would be stored in E7. Is that correct?

That seems to be what is happening.

So it really doesn't matter whether the rule is "=E7=E6" or "=E6=E7". Either way it will compare the same two cells and put the result in E6. Right?
That's right. :)
 
Upvote 0
I actually said that the result in Col E is NOT incorrect. :)

(chuckle) You are right. What I meant was that it was incorrect from what I wanted it to do. :oops:

Many years ago when I was writing assembler code, and we would often code "AR" (Add Register) when we meant "NR" (And Register), we used to joke that there ought to be a DWIM command (Do What I Meant). :oops:

Thanks for the help
 
Upvote 0
Glad to help & thanks for the feedback.

Whilst a DWIM command would be nice, there wouldn't be a need for this site :LOL:
 
Upvote 0
Glad to help & thanks for the feedback.

Whilst a DWIM command would be nice, there wouldn't be a need for this site :LOL:

Are you kidding? I could even screw that up. In fact, if the DWIM command was trying to read my mind and makes sense of it, it would get a headache and do the wrong thing. :confused:

Cheers
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,356
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top