A
A
Artem2015-04-13 17:39:05
Google
Artem, 2015-04-13 17:39:05

How to make a link in conditional formatting in Google Docs Sheets to the previous cell?

Google Docs has a table consisting of 2 columns: 1st - date, 2nd - value.
Every day, opposite the date, I put the value for today, you need it to be highlighted in red if it is less than yesterday and green if it is more.
I don't know how to link to the previous cell using conditional formatting.
I would be glad for a hint. Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan, 2015-04-23
@dohlik

1. Select the range of cells for which the formatting will be applied. For example, B2:C (in the general case, we will take not one column, but several).
2. The formula describes the rule for the top left cell, in this case it would be B2. Select the type of check "Your formula" in the drop-down list and write the formula:
=2:2>3:3
3. It is obvious that compliance with such a condition should be highlighted in green. This formula will be applied to all cells in the range, automatically increasing the numbers as you move to the bottom rows (so for the fifth row it would look like =5:5>6:6).
4. Save the rule, by analogy add the "red" rule.
In general, it is enough to write the rule as if there were one cell in the range:
=B2>B3
PS. In order not to keep track of cells that have fallen out of the conditional formatting range, I simply leave the top row empty, and insert new ones immediately after it. The range captures this empty row, so inserting a newline in it will automatically propagate the conditional formatting to it, without any fuss. Naturally, in this case, the formula will need to be a little more complicated in order to weed out the empty row and not highlight it in vain :)

H
hazestalker, 2018-02-01
@hazestalker

https://toster.ru/answer?answer_id=1167617
=INDIRECT("R[-1]C[0]";FALSE) - previous row, current column
where r - row row, c - column column
If current row is 4 , then with R[-1] there will be 3

6
69from, 2018-02-12
@69from

And I need to solve a problem more difficult:
There is a column with dates. If the string is <TODAY()+30 days, highlight it in red.
That is, all dates that will be the next 30 days should be highlighted.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question