Excel Conditional Formatting based on previous cell in column

Anonymous
2023-02-11T01:06:34+00:00

I have a log that has a column that lists a state of either Normal or Accel/Decel and would like to set the text color of numbers in another column so I can quickly differentiate between Accelerating or Decelerating.
If A2 < A1 set to red (decel)
If A2 > A1 set to green (accel)
If A2 = A1 no change

RPM State
1470 Normal
1470 Normal
1453 Accel/Decel
1427 Accel/Decel
1430 Accel/Decel
1435 Accel/Decel
1435 Normal
1435 Normal
Microsoft 365 and Office | Excel | Other | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Rich~M 20,370 Reputation points Volunteer Moderator
    2023-02-11T01:40:23+00:00

    Hi Sean. I am an Excel user like you.

    1. First select the cells that you want to show the conditional formatting. It could be in one or more columns. You need to start in Row 3, not Row 2, because you don't need to compare Row 2 to the header in Row 1.
    2. Then click on Conditional Formatting and choose New Rule.
    3. In the top half of the window click on Use a formula.
    4. You will need to enter two conditional formats, one for each of the conditions. Enter the formula in the line in the bottom half:

    =$A3>$A2

    and set the format as you want it by clicking on the Format button at the lower right which takes you to the Format Cells dialogue box--green text as described above and then OK and OK. Then repeat and enter the second formula:

    =$A3<$A2

    and set that formula's format--red text as described above. In my sample below I selected cells A3:A9 to be formatted.

    If desired you can also set other formats along with the text color for Bold, Underline, Italic, etc. when you set the formats in the Format Cells dialogue box.

    Reply if you have additional questions or information. Please mark this reply as answered if this solves fyour question.

    Rich~M

    Was this answer helpful?

    8 people found this answer helpful.
    0 comments No comments