How do I conditional format based on an increase in % from the cell directly to the left, and apply to the entire dataset (in Microsoft excel)?

45 views Asked by At

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.]

1

There are 1 answers

7
user11222393 On

Apply to range: =$C$2:$E$3

Rule for green: =C2>B2*1.2

Rule for red: =C2<B2*0.8

Result:

enter image description here