Conditional Formatting to Highlight Cell when Previous Cell was Identical

JohnTravolski

New Member
Joined
Nov 25, 2015
Messages
45
Office Version
  1. 2019
Platform
  1. Windows
I have the following formula applied to an entire column for conditional formatting:

VBA Code:
=T1=OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())),-1,0)

r/excel - Conditional Formatting to Highlight Cell when Previous Cell was Identical

This highlights a cell when the previous cell had the same value. Example:

r/excel - Conditional Formatting to Highlight Cell when Previous Cell was Identical

This is the behavior I want, except I don't want it to work in the situation where the cell is blank. Unfortunately, it does:

r/excel - Conditional Formatting to Highlight Cell when Previous Cell was Identical
I tried using this formula, but it doesn't work at all (no cells end up highlighted)

Code:
=IF(T1<>"",T1=OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())),-1,0),FALSE)

I don't understand why this doesn't work. Can anybody explain?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Seems okay. Are you sure the cells are empty? Do you have more Cf-rules?
 
Upvote 0
You could the following formula to format your cells.

=AND(ISBLANK(A1)=FALSE,A1=A2)

Kind regards


Saba
 
Upvote 0
How about
Excel Formula:
=AND(T1<>"",T1=OFFSET(T1,-1,0))
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,547
Members
449,089
Latest member
davidcom

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