Formula to use colour fonts

Dear Sir
I want to select an automatic colour scheme (font) for an Exel sheet. It has 3 columns with values. If the coloums are A, B & C I want to mark the higher value in red. If B is higher than A, B should be red. Again if C is also higher than B, then C also should be red... like that. Values should be read row-wise. How can I do this using a formula?
Thanks/ulsk

Almir's picture

Use conditional formatting along with AND function

For column B, click in e.g. B2 => Home=> Conditional Formatting => Highlight Cell Rules => Greater Than.Click on A2 and choose Cell formatting. Thus, values in column B will be red if they are higher than the values in the column A (in the same row). Copy format down the B column.

For column C use the same (if you only compare C and B columns): click in e.g. C2 => Home=> Conditional Formatting => Highlight Cell Rules => Greater Than.Click on B2 and choose Cell formatting. Thus, values in column C will be red if they are higher than the values in the column B (in the same row). Copy format down the C column.
If you need column C red only if it is both higher than B, and B is higher than A, use this:

Click in e.g. C2 => Home=> Conditional Formatting => New Rule => Use formula to determine which cells to format. Paste this into "Format values where this formula is true" field:

=AND(C2>B2;B2>A2)

Click on "Format" button to define formatting.

Thus, values in column C will be red only if they are higher than the values in the column B, and also if column B is higher than column A (in the same row). Copy format down the C column.

Got it. Thanks. But I

Got it. Thanks. But I couldn't copy the formula into other rows. How can I do it correctly. Also, the formula you gave had an error.

Almir's picture

Change references from absolute to relative

Caution: do not copy formula down. You need to copy format only.

First change referencing from absolute to relative. You can select formula and keep pressing F4 key until there is no dollar sign ($). Also, you can delete dollar signs manually.

To copy formatting, right-mouse click => Copy, select other cells, right-mouse click => Paste Special => Formatting => OK.

Almir's picture

Change references from absolute to relative

Caution: do not copy formula down. You need to copy format only.

First change referencing from absolute to relative. You can select formula and keep pressing F4 key until there is no dollar sign ($). Also, you can delete dollar signs manually.

To copy formatting, right-mouse click => Copy, select other cells, right-mouse click => Paste Special => Formatting => OK.

Almir's picture

Change references from absolute to relative

Caution: do not copy formula down. You need to copy format only.

First change referencing from absolute to relative. You can select formula and keep pressing F4 key until there is no dollar sign ($). Also, you can delete dollar signs manually.

To copy formatting, right-mouse click => Copy, select other cells, right-mouse click => Paste Special => Formatting => OK.