Tuesday, April 5, 2016

Excel conditional formatting if cell equals previous cell

Setting a column of cells to each show a color if it matches the previous cell in the column is a very quick way to check for doubles. In the versions of Excel that I am using, mostly 2013, this is done by selecting the first (or second) cell in the column, clicking the "Conditional Formatting" button on the ribbon, selecting "New Rule", "Use A Formula", where it says "Format values where this formula is true" enter a simple conditional like "$A2=$A1", click the format button and select a color fill. Then select the cell you just formatted and hit Ctrl-C, select all the other cells in the column and using right click do a "Paste Formatting".

This link has this procedure:

https://www.ablebits.com/office-addins-blog/2014/06/10/excel-conditional-formatting-formulas/

Here's a slightly more involved example:

http://stackoverflow.com/questions/16175007/excel-conditional-formatting-based-on-cell-and-adjacent-cell-values

Here's the syntax if you want to the conditional formatting to show if two cells on the same row are not equal:

http://superuser.com/questions/637073/excel-conditional-formatting-if-one-column-equal-to-another