ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Percentage difference calc that knows the largest figure (https://www.excelbanter.com/excel-discussion-misc-queries/54742-percentage-difference-calc-knows-largest-figure.html)

Mighty Magpie

Percentage difference calc that knows the largest figure
 
I have a calculation in cell A3 which looks at the content of Cell A1 and
Cell A2 and then works out the difference between both as a percentage



For instance



Cell A1 = 100

Cell A2 = 10

Cell A3 returns the difference as being 90%



My simple calculation in Cell A3 is as follows =(A1-A2)/A1



Cell A3 is formatted to give the answer as a percentage to 2 decimal places



The above works fine as long as the number in Cell A1 is greater than the
number in Cell A2



If the number in A2 is greater than the number in A1 then my calculated
answer is incorrect



For instance

Cell A1 = 10

Cell A2 = 100

Cell A3 returns the difference as being -900%



Can someone please tell me of a way in which I can input one formula in cell
A3 that will look at both A1 and A2 then recognise which is the greater
number and give me resultant percentage difference?



Is it possible?



TIA



goober

Percentage difference calc that knows the largest figure
 

=IF(A1A2,(A1-A2)/A1,(A2-A1)/A2)

This should help you.

Good Luck.


--
goober
------------------------------------------------------------------------
goober's Profile: http://www.excelforum.com/member.php...o&userid=19838
View this thread: http://www.excelforum.com/showthread...hreadid=483896


Mighty Magpie

Percentage difference calc that knows the largest figure
 
Thanks for the info and prompt response - I am grateful


"goober" wrote in
message ...

=IF(A1A2,(A1-A2)/A1,(A2-A1)/A2)

This should help you.

Good Luck.


--
goober
------------------------------------------------------------------------
goober's Profile:
http://www.excelforum.com/member.php...o&userid=19838
View this thread: http://www.excelforum.com/showthread...hreadid=483896




Mighty Magpie

Percentage difference calc that knows the largest figure
 
Many thanks for that - it works fine

Cheers


"Mighty Magpie" <mighty.magpie@home wrote in message
...
Thanks for the info and prompt response - I am grateful


"goober" wrote in
message ...

=IF(A1A2,(A1-A2)/A1,(A2-A1)/A2)

This should help you.

Good Luck.


--
goober
------------------------------------------------------------------------
goober's Profile:
http://www.excelforum.com/member.php...o&userid=19838
View this thread:
http://www.excelforum.com/showthread...hreadid=483896







All times are GMT +1. The time now is 10:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com