ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   calculating the difference between 2 numbers (https://www.excelbanter.com/excel-worksheet-functions/36887-calculating-difference-between-2-numbers.html)

Darran

calculating the difference between 2 numbers
 
Does anyone know if it is possible to put together a sum that will add up the
difference between 2 numbers in a cell. for example if 28 is in A1 and 38 is
in A2 the sum would give me the answer of 10. This would be simple if the
higher number was always in colum 2 but what happens if instead of 38 in A2
it was 23. The difference would be 15. I dont want any minus figures.

Is this possible or have I confused everyone that reads this?!!!

Darran.

JE McGimpsey

One way:

Check out the ABS function in Help:

=ABS(A2-A1)

In article ,
Darran wrote:

Does anyone know if it is possible to put together a sum that will add up the
difference between 2 numbers in a cell. for example if 28 is in A1 and 38 is
in A2 the sum would give me the answer of 10. This would be simple if the
higher number was always in colum 2 but what happens if instead of 38 in A2
it was 23. The difference would be 15. I dont want any minus figures.

Is this possible or have I confused everyone that reads this?!!!


bj

try
=abs(a1-a2)

"Darran" wrote:

Does anyone know if it is possible to put together a sum that will add up the
difference between 2 numbers in a cell. for example if 28 is in A1 and 38 is
in A2 the sum would give me the answer of 10. This would be simple if the
higher number was always in colum 2 but what happens if instead of 38 in A2
it was 23. The difference would be 15. I dont want any minus figures.

Is this possible or have I confused everyone that reads this?!!!

Darran.


Darran

Thank you both very much, just what I was after so top marks to the both of
you.

Darran




"bj" wrote:

try
=abs(a1-a2)

"Darran" wrote:

Does anyone know if it is possible to put together a sum that will add up the
difference between 2 numbers in a cell. for example if 28 is in A1 and 38 is
in A2 the sum would give me the answer of 10. This would be simple if the
higher number was always in colum 2 but what happens if instead of 38 in A2
it was 23. The difference would be 15. I dont want any minus figures.

Is this possible or have I confused everyone that reads this?!!!

Darran.



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

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