Possible formula or function

Copper Contributor

Is there a formula or function available that highlights a box containing a certain number when this number is type in another box  in the document?

 

Context: This is for our in-office lottery. I would like the boxes containing the weekly numbers to automatically by highlighted when I enter them in the spreadsheet.

 

AnnDegrace_0-1614257740493.png

1 Reply

@AnnDegrace If I understand correctly, you want the cells in B1 (or cell where the first number of the first employee is) through G4 or cell where the last number of the last employee is) to highlight yellow if the number in the cell is found in J1 (or first cell you enter a number in) through N4 (or last cell you enter a number in). I'm not certain if the grid to the right is located in another worksheet, or if it's relative to the discussion, but similar instructions can be used. You want to use Conditional Formatting on the Home tab. Select all of the cells you want to change color, then click Conditional Formatting, then select New Rule, then click on Use a formula to determine which cells to format. In the box that says Format values where this formula is true: enter "=COUNTIF($J$1:$N$4,B1)>0" without the ". The $J$1 should be the top left cell you will be entering the numbers in, and $N$4 should be the last. B1 will be the top left cell of your employee numbers. Next click the Format button, select the Fill tab, and choose your color, then click OK, and then OK again. If you want the grid to highlight also follow the same instructions, except you will select the grid instead of the employee numbers, and the B1 in the formula will be the top left cell of the grid.  I hope this helps.