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

Fractalis

Active Member
Joined
Oct 11, 2011
Messages
328
Office Version
  1. 365
Platform
  1. Windows
Hello

I have values from A1:D4 like this:
[table="width: 500, class: grid, align: center"]
[tr]
[td][/td]
[td]A[/td]
[td]B[/td]
[td]C[/td]
[td]D[/td]
[/tr]
[tr]
[td]1[/td]
[td]a[/td]
[td]b[/td]
[td]1[/td]
[td]d[/td]
[/tr]
[tr]
[td]2[/td]
[td][/td]
[td][/td]
[td]2[/td]
[td][/td]
[/tr]
[tr]
[td]3[/td]
[td][/td]
[td][/td]
[td]3[/td]
[td][/td]
[/tr]
[tr]
[td]4[/td]
[td]x[/td]
[td]h[/td]
[td]5[/td]
[td]d[/td]
[/tr][/table]

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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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