CF to check if the cell is > or < than RELATIVE cell

drewberts

Board Regular
Joined
Sep 5, 2013
Messages
159
I have data for months and years as follows:-

2017 2018 2019 2020
Jan 150 175 160 200
Feb 160 170 180 220
Mar 210 185 160 200
Apr 195 200 200 250
...

I want to apply CF to show whether the same month is > or < than the same month in the previous year e.g. so if Jan 2017 is < Jan 2018 then the cell goes red, > it goes green. I'm trying to do it so it shows a comparision between a month and the same month in the previous year to that month. Hope than makes sense
 

Some videos you may like

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,387
Office Version
  1. 365
Platform
  1. Windows
You will have conflicting rules there. For example March 2018 would be both red and green. What takes precedent? Anyway you can change the order because you will need two rules eg:

=AND(B2<C2,C2<>"")
=AND(B2>C2,C2<>"")

applied to B2:E5
 

drewberts

Board Regular
Joined
Sep 5, 2013
Messages
159
You will have conflicting rules there. For example March 2018 would be both red and green. What takes precedent? Anyway you can change the order because you will need two rules eg:

=AND(B2<C2,C2<>"")
=AND(B2>C2,C2<>"")

applied to B2:E5
Thanks March 2018 will only be compared to March 2017 (the same month in the previous year). March 2019 will only be compared to March 2018 and so on.
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,387
Office Version
  1. 365
Platform
  1. Windows
Sorry yes i just realised that. So you need just this:

=C2<B2
=C2>=B2

Applied to C2:E5
 

drewberts

Board Regular
Joined
Sep 5, 2013
Messages
159
Sorry yes i just realised that. So you need just this:

=C2<B2
=C2>=B2

Applied to C2:E5
Many thanks Steve - I get the relative cell references now. I was massively trying to over think this. However, without moving the goal posts I was simply going to apply this to Icon sets - but relative cell refs don't work with this. Therefore I presume a completely different approach is needed if I wanted to go down that route (cell fill colours make the data far to complicated to read)?
 

Watch MrExcel Video

Forum statistics

Threads
1,127,647
Messages
5,626,073
Members
416,160
Latest member
SanbiVN

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top