Difference in longitude between two hemispheres

l1011driver

Board Regular
Joined
Dec 26, 2014
Messages
68
Office Version
  1. 365
Platform
  1. Windows
One formula in my spreadsheet needs to know how many degrees of longitude exist between two geographical points. I'm really scratching my head on how to calculate this difference when the points of longitude are in different hemispheres.

For example, if one point is at 140 degrees east longitude (denoted as 140) and the other point is at 140 degrees west longitude (denoted as -140), that's a difference of 80 degrees of longitude. Can anyone help me out with a formula that will make this calculation? I would like to find a formula that would correctly calculate the difference in longitude between two points in the same hemisphere as well.

Thank you to anyone who has any suggestions.

Sincerely,

L1011driver
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Two methods below, there may be other ways to do it:
Book1
ABC
1-140140
2
3-80
4-80
Sheet1
Cell Formulas
RangeFormula
C3C3=IF(ABS(B1-A1)<=180,B1-A1,IF(B1>A1,B1-A1-360,B1-A1+360))
C4C4=MOD(B1-A1+540,360)-180
 
Upvote 0
Hi Georgiboy. Both of these formulas worked perfectly. I kept fiddling with the MOD function but I just couldn't figure out how to get it to work. I see how you did it and it makes perfect sense.

I gotta ask: are you from Georgia? I lived in Savannah for several years.

Thank you so much for helping. Take care and stay safe.

Sincerely,

L1011driver
 
Upvote 0
Glad you got it sorted, I am not from Georgia - I am from the Garden of England (Kent, UK) but my name is George
 
Upvote 0
Glad you got it sorted, I am not from Georgia - I am from the Garden of England (Kent, UK) but my name is George
Hi Georgiboy,

You were so great before, perhaps I can ask you another one?

I have a spreadsheet that has time in 1 minute increments. In an adjacent column I have a date corresponding to each 1-minute increment of time.

What I would like to do is have the date cell advance to the next day when the corresponding time cell reaches midnight (00:00). Subsequent date cells would reflect the "new" date until again reaching midnight on that day.

If you have any suggestions or help I'd be grateful. It seems my laptop doesn't like XL2BB so I'll attach a screen shot of what I'm talking about. I use a formula for column C, but column B is just the date copied to each subsequent cell. The formula bar shows the formula I use for the 1-minute increments of time.
Screenshot (25).png


Thanks for any suggestions you may have.

Sincerely,

Mark Barnard
 
Upvote 0
Hi Mark,

As this is not related to the original request - you should start a new thread (I will be happy to look at it though)

It will be worth updating your profile to show what version of Excel you are using as this will change the solutions offered. If it is to be used on an older version than what your profile displays then it would be worth mentioning that.

George
 
Upvote 0
Hi Mark,

As this is not related to the original request - you should start a new thread (I will be happy to look at it though)

It will be worth updating your profile to show what version of Excel you are using as this will change the solutions offered. If it is to be used on an older version than what your profile displays then it would be worth mentioning that.

George
Thanks, George. I will put it in a new thread. I just kind of enjoyed dealing with you. You're very patient with an old guy.

I'll look at how to update the profile, too. I use Excel 365.

Thanks and take care.

Sincerely,

Mark
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,613
Members
449,090
Latest member
vivek chauhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top