Using Microsoft Excel, I would like to use conditional formatting to highlight trends within a large database. The dataset contains 2000+ rows of data set out like this:
| Country | 2020 | 2021 | 2022 | 2023 |
|---|---|---|---|---|
| South Africa | 10300.21 | 12423.04 | 12302.29 | 29193.20 |
| Sri Lanka | 10140.48 | 15426.09 | 12242.67 | 14693.43 |
I would like to use conditional formatting within Excel to highlight cells for which the value is 20% larger (green) than the cell directly to the left. I would also like to highlight cells (red) for which the value is 20% lower to the cell directly to the left. I would like to use this formatting for the entire dataset, but ideally a quick way which means not performing the formatting row-by-row.
If this isn't possible using Excel, I would appreciate any advice for performing this using R.
Thanks for your help!
[I tried performing this using Excel but struggled find ways to to duplicate this row-by-row without using the conditional formatting tool on every row individually.]
Apply to range:
=$C$2:$E$3Rule for green:
=C2>B2*1.2Rule for red:
=C2<B2*0.8Result: