0

Looking to see if there is a way on Excel to do an If with a rule that grays out the other cell.

Basically, if one cell (out of 2 columns) gets an X, gray out the other one automatically. If they both don't have anything, leave them blank. Is there a way to do this? I've attached a snapshot:

Example

GSerg
  • 76,472
  • 17
  • 159
  • 346
  • 2
    `a rule that grays out the other cell` - no, but it's trivial with [conditional formatting](https://support.microsoft.com/en-us/office/use-conditional-formatting-to-highlight-information-fed60dfa-1d3f-4e13-9ecb-f1951ff89d7f) to gray out *this cell* based on the state of other cells, which is what you want expressed the other way round. – GSerg Jan 13 '22 at 18:47
  • see https://stackoverflow.com/questions/20545961/conditional-formatting-based-on-another-cells-value – JB-007 Jan 15 '22 at 23:22

1 Answers1

0

YES - THERE IS A WAY !

Select c3:d6 per screenshot (1st table) and then enter this formula for the conditional formatting rule:

=SUM(1*(IFERROR(UNICODE($C3:$D3),0)=88))*(C3="")

Cell references for main function "X" and varants/mods

Notes:

  • applicable for "X" per your 2nd sentence
  • assumes no shading if both cells contain "X"

Unequivocally, this is a 'rule/function that grays out one of the cells is the other has an "X" ', or, per original Q:

"if one cell (out of 2 columns) gets an X, gray out the other one automatically... is there a [i.e. any] way to do this?"


Mods:

1] For any non-blank (not just "X"):

 =SUM(1*($C3:$D3<>""))*(C3="")

2] Case insensitive variant (i.e. allow "X" or "x"):

=SUM(1*($C3:$D3="x"))*(C3="")

(sum function treats "X" the same as "x", so could use either for this mod)


References: Wiki (unicodes)