×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Add or subtract polar degrees in Excel

 Forum Search FAQs Links MVPs

## Add or subtract polar degrees in Excel

(OP)
Can some one please show me how to add or subtract polar degrees in MS Excel (2003).
I have two polar values (anywhere from 0 to 360 degrees), A1=10 A2=359.5 A3=MOD(A1-A2,360)which returns the correct value of 10.5
But.. if A1=350 and A2=359.5 A3=MOD(A1-A2,360) returns 350.5 and not the correct value of 9.5 degrees. Can this be fixed with a pile of "IF" .. THEN" statements.. or there must be a better way

Thank you for your time, it is very much appreciated.
Ralph

### RE: Add or subtract polar degrees in Excel

(OP)
Yes.. technically but I would like to display the smaller of the two correct answers.. ie a difference of 20 degrees.
A1 350 degrees
A2 10 degrees
A3=MOD(A1-A2,360) which returns 340.. which is correct but I want it to show 20 degrees.

+20 or -20?

### RE: Add or subtract polar degrees in Excel

Something like:

=MIN(MOD(A1-A2,360), 360-MOD(A1-A2,360))

### RE: Add or subtract polar degrees in Excel

(OP)
Perfect.. Thank you very much

### RE: Add or subtract polar degrees in Excel

So, what answer do you "want" for 351 -> 14? 9+14 = 23 degrees? (Both of their differences from 360) or do you want (351-14) = 337

### RE: Add or subtract polar degrees in Excel

Or am I mis-understanding your 10 -> 350 example? Where you wanted "20"?

### RE: Add or subtract polar degrees in Excel

(OP)
Thank you racookpe
The solution that MintJulep (Mechanical) gave me is doing exactly what I wanted.
=MIN(MOD(A1-A2,360), 360-MOD(A1-A2,360))

### RE: Add or subtract polar degrees in Excel

Seems like op wants the smallest measure of the angle between two vectors A1 and A2 without keeping track of the "polarity" of the result (polarity might otherwise be expressed as negative/positive, CW/CCW, A1 leads A2 or A2 leads A1).

In most applications (balancing for example), it would be important to track the polarity (sign) that results from vector subtraction. But we don't know his application.

=====================================
(2B)+(2B)' ?

### RE: Add or subtract polar degrees in Excel

Sorry - I introduced vector subtraction which was not particularly implied by original post.

Maybe I should have just said he wants to know the distance between two angles, expressed as an angle less than 180 degrees, without regard for the polarity.

=====================================
(2B)+(2B)' ?

### RE: Add or subtract polar degrees in Excel

#### Quote (electricpete)

he wants to know ..
Rather, I'm guessing at a word description which was never given in original post but can be inferred from the answer that he liked.

=====================================
(2B)+(2B)' ?

### RE: Add or subtract polar degrees in Excel

(OP)
Sorry for all the confusion. I was making a spreadsheet that would do all kinds of calculations pertaining to balancing. Calculate various tolerances, force generated by a known unbalance, combine weights to a single location, divide a given weight into two components. And some other trivia. The question that started this was.. if I have a force at say 10 degrees and another at 345 degrees, what is the difference? It could be 25 or 335 degrees. For my application I wanted the smaller (shorter) value of 25.

### RE: Add or subtract polar degrees in Excel

Polarity is maintained. If you want the absolute value, just add that function to the string.

But forces have magnitude as well as direction, so vector subtraction as electricpete suggested may be appropriate.

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

#### Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!