Conditional Formatting to Highlight Cell when Previous Cell was Identical

JohnTravolski

New Member
Joined
Nov 25, 2015
Messages
38
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?
 

Some videos you may like

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

mart37

Well-known Member
Joined
Aug 4, 2017
Messages
1,068
Office Version
  1. 2016
Platform
  1. Windows
Seems okay. Are you sure the cells are empty? Do you have more Cf-rules?
 

Saba Sabaratnam

Board Regular
Joined
May 26, 2018
Messages
196
You could the following formula to format your cells.

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

Kind regards


Saba
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,626
Office Version
  1. 365
Platform
  1. Windows
How about
Excel Formula:
=AND(T1<>"",T1=OFFSET(T1,-1,0))
 

Watch MrExcel Video

Forum statistics

Threads
1,127,755
Messages
5,626,671
Members
416,200
Latest member
Pulsar3000

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
Top