|Conditional formatting doesn't work over a range (e.g. A1:A7), it works on one cell at a time (A1). However, it can be applied to an entire range in one move:|
Select A1:B7 and use this formula for CF. Note the placement of the $.
When you want to Conditionally Format a range of cells, you Select the entire range, but you use a formula that only refers to the first cell. Excel knows to apply the CF to the entire range, changing the address as appropriate.
Now, in this case, we need to use $ on the columns otherwise Column B would end up being CF'd with: