Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
• Status: Solved
• Priority: Medium
• Security: Public
• Views: 396

# code or valadation to highlight cell yellow

I want to highlight a cell if the following orrors:

if c5 = "" and c6 = something then highlight c5
and if c6 = "" and c5 = something then highlight c6

when there is 'something' in c5 and c6 OR there nothing in c5 and c6 then NO highlighting.

Hi experts,
I need to do this to multiple double cell throughout my sheet.

example attached:

Cheers

Rob.
Highlighting.xlsx
0
RobJanine
• 3
1 Solution

Commented:
RobJanine,

Conditional Formatting formula is ...
=OR(AND(MOD(ROW(),2)=1,D5="",D6<>""),AND(MOD(ROW(),2)=0,D5="",D4<>""))

Regards,
Brian. Highlighting-V2.xlsx
0

EngineerCommented:
Try this formula

=MOD(COUNTA(D5,OFFSET(D5,2*(MOD(ROW(),2)-0.5),0)),2)*(D5="")
0

Commented:
Please note, the formula is "row-sensitive". So, if it "starts" on an even-numbered row then the formula should be...
=OR(AND(MOD(ROW(),2)=0,D5="",D6<>""),AND(MOD(ROW(),2)=1,D5="",D4<>""))
0

Author Commented:
Works Great!!! Thanks
0

Commented:
Thanks, RobJanine!
0

## Featured Post

• 3
Tackle projects and never again get stuck behind a technical roadblock.