How to extend conditional formatting before appears a new value in Col B?

Fractalis

Active Member
Joined
Oct 11, 2011
Messages
310
Office Version
  1. 2019
Platform
  1. Windows
Hello

I have values from A1:D4 like this:
ABCD
1ab1d
22
33
4xh5d

If value on column B="b" I have a conditional formatting to highlight in green the row where "b" is present (in this case in row 1). If value in column B="h" then I have a conditional formatting to highlight in yellow the row where "h" is present (in this case in row 4)

How can I extend the formatting in order that If B1="b" be highlighted automatically in green all range from A1:D3? This is highlight in green all the values in range before a new value appears in column B.

The issue is the number of values in column C could be one or more.

Thanks in advance for any help.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Try

Select A1:D4

Rule 1
=LOOKUP(2,1/($B$1:$B1<>""),$B$1:$B1)="b"
Fill --> Green

Rule 2
=LOOKUP(2,1/($B$1:$B1<>""),$B$1:$B1)="h"
Fill --> Yellow

Hope this helps

M.
 
Upvote 0
Try

Select A1:D4

Rule 1
=LOOKUP(2,1/($B$1:$B1<>""),$B$1:$B1)="b"
Fill --> Green

Rule 2
=LOOKUP(2,1/($B$1:$B1<>""),$B$1:$B1)="h"
Fill --> Yellow

Hope this helps

M.
Oi Marcelo,

It works just exactly as I wanted. Muito obrigado.

Regards
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,535
Messages
6,120,093
Members
448,944
Latest member
SarahSomethingExcel100

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