Excel absolute difference between 2 values

Pascal -  
 guyguy -
Hello,
In an Excel spreadsheet, I'm looking for the formula that calculates the difference between 2 values, the result should be in absolute value (without a positive or negative sign).
Thank you very much for your help.
Configuration: Windows XP Internet Explorer 6.0

1 answer

  1. gbinforme Posted messages 14930 Registration date   Status Contributor Last intervention   4 744
     
    Hello

    With your data in A1 and B1, this should solve your issue
    =IF(A1>B1;A1-B1;(A1-B1)*-1)

    --

    Always zen
    19
    1. Pascal
       
      Thank you very much.
      0
    2. LexMarc
       
      Hello

      Why not use the Absolute function = ABS(A1-B1)
      More economical in terms of memory used

      @+ LM
      3
      1. qlio1 > LexMarc
         
        Thank you very much.
        0
    3. guyguy
       
      Thank you for keeping me informed.
      0