Racer SQL
Racer SQL

Reputation: 217

How to compare column, and define it it's increasing or decreasing in value?

For a example, I have these columns:

| name  | col1 | col2 | 
|-------|------|------|
| base1 | 2    | 3    | 
| base2 | 2    | 2    |

I want to use a conditional formatting to, in the col2 to show an Up arrow, or a Down arrow, checking the previous column to see if the value it's bigger, or lower, or 0.

How can I achieve this? I'm creating a lot of settings but I can't achieve this.


EDIT1:

So, I see I got some good answers. But I will need to do something like this:enter image description here

These are sizes of my sql server databases. I would like to compare D1 with B1, and E1 with C1. But then, after this first compare, I would like to compare F1 with D1 and G1 with E1. I don't think this is posible with a formula, it will be something really manual. I just want to compare the last value, with the previous one, to see how's the growth is, well, growing.

Upvotes: 0

Views: 646

Answers (1)

Tom Sharpe
Tom Sharpe

Reputation: 34265

You can also do it from first principles using a format like

#↑

and a formula like

=B1>A1

enter image description here

getting the up and down arrow from a spare cell where I've used Insert Symbol

Upvotes: 2

Related Questions