Comparison between two numbers

slam

Well-known Member
Joined
Sep 16, 2002
Messages
921
Office Version
  1. 365
  2. 2019
I have two columns that contain positions 1st through 16th, (A2:A17 and D2:D17) and need to do a comparison between the two to show the difference in column I. In addition, I would like the cell shaded depending on whether there’s a negative, positive or neutral result.

A couple of examples of what I need:

A2 contains 1st, and D2 contains 10th, I would want I2 to display +9 and be shaded green
A8 contains 7th, and D8 contains 2nd, I would want I8 to display -5 and shaded green

If the two values match (16th and 16th), I would want a 0 displayed and the cell shaded yellow.

Any help would be greatly appreciated.

Thanks
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
It's probably also worth me adding that column D is the result of the following formula:

=IF(ISBLANK(E2),"",RANK(E2,$E$2:$E$17,1)&LOOKUP(RANK(E2,$E$2:$E$17,1),{1,2,3,4},{"st","nd","rd","th"}))

Column A is just text.

Thanks
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,809
Members
452,944
Latest member
2558216095

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
Back
Top