"Dynamic" conditional formatting formula

Masquette

New Member
Joined
Dec 11, 2024
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi, it feels like this should be a simple operation but I can't for the life of me make it work.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
i need a lot more information to be able to help you , as i dont know what the issue is

ALSO

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
Sorry, that posted without me intending it to and I don't know how to edit it....

Say I have

AB
155
246
331

I want to make a conditional formula that will iterate through the rows comparing if A1=B1, A2=B2, A3=B3, etc. and changing A1 to blue if true.

In the conditional formatting box, with the anchor cell being A1, I add the formula =$B1 → blue. Great, this works, then if I apply the formatting to the whole of column A the formula is not "reformulating" to iterate through the rows so everything comes back blue because, effectively A1=B1, even though A2 is not equal to B2.

Does this make sense? Does anyone know how I can fix this? Thanks in advance.
 
Upvote 0
try using a rule
=AND($A1<>"",$A1=$B1)

Book1
ABC
155
246
331
4
5
6
7
8
9
10
11
12
13
14
15
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A:AExpression=AND($A1<>"",$A1=$B1)textNO


for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>
Select Column A - Change, reduce or extend the rows to meet your data range of rows

Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:
=AND($A1<>"",$A1=$B1)

Format [Number, Font, Border, Fill]
choose the format you would like to apply when the condition is true
OK >> OK
 
Upvote 0
Thanks, I've tested this out and it seems to work well. I appreciate it. Unfortunately I don't really know all the reasoning behind this particular formula, so I never would have got there on my own. Thanks so much for helping!
 
Upvote 0
you are welcome

AND()
is a LOGIC Function and will return a TRUE - only if all the condions are TRUE
this condition
$A1=$B1
will only return TRUE if A1 - B1

And then as a Blank cell = a blank cell and we dont want to Highlight ALL the blank cells
then we use
$A1<>""
So if A1 is BLANK thats a FALSE - and so will NOT allow the AND() to return TRUE
hence
ONLY cells that are NOT Blank in column A - will be compared to column B and only TRUE if they match

=AND($A1<>"",$A1=$B1)
 
Upvote 0
I appreciate you taking the time to explain this to me. Thank you. It's very helpful to learn in this way. Best wishes, Maria
 
Upvote 0

Forum statistics

Threads
1,224,836
Messages
6,181,251
Members
453,027
Latest member
Lost_in_spreadsheets

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