I will like the format the same cell in google sheet, to be more specific, any positive increase to the previous value (same cell) will turn green, and any negative decrease to the previous value (same cell) will turn red, for example: if a have cell A2= 100, and I then change A2 to 90, I will like that cell to turn red, if I then change it to 95 it will turn green.

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Apr 1, 2023 at 19:35
  • Sheets will conditionally format based on a formula. For example you could use A2<100 or A2>100 or A2=90
    – Blindspots
    Apr 1, 2023 at 19:56

1 Answer 1


You could solve this problem with an helper column and a script like:

function onEdit(e) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var currRow = sheet.getActiveCell().getRow();
var cell = sheet.getRange(currRow,2);
cell.setValue( e.oldValue);

See this demo

note that this is just a quick example to refine with column checking

  • Thank you, this is exactly what I needed.
    – Jose Dlr
    Apr 2, 2023 at 23:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.