MechanicalMan
MechanicalMan

Reputation: 145

Conditional formatting for binary values

I'm trying to set up some conditional formatting for binary values in excel 2013. There are two or three 'acceptable' binary values in the sheet, if someone inputs values that do not match these, I want the cell to auto-format to highlight itself so the user knows that the value requires double-checking and additional attention. So, let's say:

00011010 or 01001011 are ok values, and when in the cell, the cell is 'usual' excel formatting (calibri, 11pt, etc). Any other value (be it 'binary' or text), and it lights up red.

None of these values actually do any binary math (or really any math), so they can be text strings if that'll work. But it does need to be able to recognize 'either or' Ave to highlight any input other than the values it is looking for.

I would like to keep it to conditional formatting since I have no experience with VBA, but I'm not unfamiliar with programming in general, so I can probably make VBA work if that's the only way.

Upvotes: 0

Views: 1875

Answers (2)

BruceWayne
BruceWayne

Reputation: 23285

If A1 has some data, you can use:

=AND(A1<>"00011010",A1<>"01001011")

Now, if only column A has these values you're looking for, anchor the column (so do $A1) just to make sure it's always looking in col. A.

Upvotes: 1

Opzen
Opzen

Reputation: 1

  1. Select Range of Cells
  2. Conditional Formatting
  3. Use a Formula to Determine which cells to Format
  4. =AND(COUNTIF($A1:$D1,BINARY STRINGS HERE)=1,A1<>0)

It's basically a conditional formatting for "NOT IN", followed by your list of acceptable binary values.

Upvotes: 0

Related Questions