Given that you have pairs of values in column A and B, the result you
are seeking can be achieved by using a conditional IF statement in
your function. We test whether either number is non-numeric, and we
only provide a calculated value if the calculation is possible. To
calculate the percentage difference I am using the standard formula of
So, when calculating the percentage difference between A1 and B1, for
example, the function is:
=IF(AND(ISNUMBER(A1),ISNUMBER(B1)), ((B1-A1)/A1)*100, 0)
We can colour code these result using what is known as conditional
formatting in Excel. Here are the steps:
1. Select the cells for which a value is being calculated (I just
chose the entire column C)
2. Go to Format > Conditional Formatting
3. Place the first condition as "Cell value is greater than 0"
4. Set the Format for this condition by clicking the Format button and
changing the colour as desired.
5. Click "Add" to create a second condition, which is "Cell value is
less than or equal to 0".
6. Set the Format for the second condition
7. Click OK
You should now have cells that are formatted on the basis of the value
that is being calculated. You're done!
If you have any problems understanding the information above, please
let me know by posting a clarification.
Thanks for using Google Answers.