Conditional Formatting based on map coordinates

Transport77

New Member
Joined
Sep 6, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I'm in logistics...I have several warehouses within a few miles of each other and I have a Excel spreadsheet detailing trailers supposedly parked at each location. This spreadsheet details the trailers' current/most recent GPS coordinates...latitude in one cell column and longitude in the next cell column. I am attempting to use conditional formatting to highlight where each trailer is located based on the coordinates listed (so I don't have to search each one). So, if a warehouse is between a particular latitude range and longitude range, I'd like the given GPS coordinates (both the latitude and longitude cells on the row) to be highlighted if they fall within the ranges for a particular warehouse. However, some of my warehouses have either overlapping latitudes or longitudes. So while the latitude may highlight correctly, the longitude may not because the trailer's longitude coordinate is within that overlap, and vice versa. I'm trying to figure out a formula rule for each warehouse location to basically say:

* For the latitude column..."if the latitude is between this range and the longitude is between this range, then highlight the latitude this color."
* For the longitude column..."if the longitude is between this range and the latitude is between this range, then highlight the longitude this color."
* so that both coordinates are highlighted the same to match the color designated by the location.

How would I properly write these rules and apply them both the latitude and longitude columns? Any help would be greatly appreciated!
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Could you please supply some dummy data ( with the overlaps ) that can be used as we don't know how you lat & long values are displayed in your columns
e.g

34°28'N
42.546245 1.601554
 
Upvote 0
The GPS coordinates are reported as just a number to hundred thousandths decimal (6), latitude in one column and latitude in the next column. I have plotted out each building location to basically their property lines, thus providing their designated latitude and longitude ranges. So, to provide an example...

Bldg A has a latitude range of 10.000000 to 20.000000 and a longitude range of 10.000000 to 15.000000.

Bldg B has a latitude range of 25.000000 to 30.000000 and a longitude range of 12.000000 to 17.000000.

Bldg C has a latitude range of 27.000000 to 35.000000 and a longitude range of 30.000000 to 40.000000.

As you can see, there is a longitude overlap between Bldgs A & B and a longitude overlap between Bldgs B & C.

If a trailer's GPS coordinates are 17.000000 latitude and 13.000000 longitude, what would the conditional formula be to have the longitude cell reflect that the trailer is at Bldg A?

If another trailer's GPS 28.000000 latitude and 35.000000 longitude, what would the conditional formula be to have the latitude cell reflect that the trailer is at Bldg C?
 
Upvote 0
Something like this
Book1
ABCDEF
1BldgLatMnLatMxLongMnLongMx
2A10.00000020.00000010.00000015.000000
3B25.00000030.00000012.00000017.000000
4C27.00000035.00000030.00000040.000000
5
6TrailerLatLong
7D33.00000037.000000
8E25.00000014.000000
9F26.00000013.000000
10G28.00000032.000000
11H20.00000040.000000
12I15.00000010.000000
13J15.00000021.000000
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A7:A13Expression=AND($B7>=$B$2,$B7<=$C$2,$C7>=$D$2,$C7<=$E$2)textNO
A7:A13Expression=AND($B7>=$B$3,$B7<=$C$3,$C7>=$D$3,$C7<=$E$3)textNO
A7:A13Expression=AND($B7>=$B$4,$B7<=$C$4,$C7>=$D$4,$C7<=$E$4)textNO
 
Upvote 0
Solution

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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