+ Reply to Thread
Results 1 to 3 of 3

Formula to find difference between two values

  1. #1
    Registered User
    Join Date
    06-16-2017
    Location
    Sydney
    MS-Off Ver
    2016
    Posts
    6

    Formula to find difference between two values

    Hi guys,

    I'm trying to find a formula that will give me the difference between two values which are angles of a compass.

    Example
    Cell A = 360
    Cell B = 090
    Cell C = 270

    Cell A is the primary degree
    B difference to A = 90 Degrees
    C difference to A = 90 Degrees

    It must not give me a negative value so it can't be "A+B" or "A-B". only the difference represented by a positive value.

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Formula to find difference between two values

    For A and B =MIN(MOD(A1-B1,360), 360-MOD(A1-B1,360))
    For A and C =MIN(MOD(A1-C1,360), 360-MOD(A1-C1,360))

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,453

    Re: Formula to find difference between two values

    I would probably include a simple IF() function (or 2) as part of the calculation to detect when it gives negative values (or values above 180). Something like =IF(B-A<0,B-A+360,IF(B-A>180,360-B+A,B-A)) or something like that.

    If that was not suitable, I might consider an approach using trig ratios to convert negative angles to positive angles.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Find difference in 2 values based on VLOOKUP
    By scaffdog845 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-20-2014, 01:09 PM
  2. Replies: 5
    Last Post: 04-20-2014, 08:39 PM
  3. Replies: 7
    Last Post: 08-07-2013, 11:57 AM
  4. Column of incrementing values, find difference.
    By Lectrician in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-08-2012, 04:17 PM
  5. [SOLVED] Find common values, Consolidate data and create Worksheet with difference
    By hnpsingh in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-28-2012, 04:22 PM
  6. Find numerical difference between text values.
    By mattcon in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-21-2008, 08:02 PM
  7. [SOLVED] How do you find the difference between two time values when one i.
    By tubroh730 in forum Excel General
    Replies: 1
    Last Post: 03-25-2005, 01:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1