Function Problems

How to Extract Latitude and Longitude from an Excel Cell

Aamir Naveed AkramAamir Naveed Akram Nov 2, 2026 869 views

Question details

The user needs to extract latitude and longitude coordinates formatted like (40.854715, -73.908753) from a single address string into two separate numerical columns.

How to Extract Latitude and Longitude from an Excel Cell
Product
Excel
Device & OS
not provided
Scenario
Separating combined geographical coordinates into individual latitude and longitude columns for mapping or geographical data analysis.
Observed behavior
Coordinates are currently combined within parentheses as a single text string, preventing independent sorting or calculations for the specific latitude and longitude values.
Before you start

Ensure your source data consistently formats coordinates within parentheses and separates them with a comma. Inconsistent formatting or missing brackets will cause formula errors.

Solution 1Recommended

Extract Coordinates Using MID and FIND Formulas

Use a precise combination of MID and FIND functions to locate the parentheses and comma, isolating the exact numerical values for both latitude and longitude.

This method searches for specific characters (like brackets and commas) to dictate where Excel should start and stop extracting the text.

The formulas use a double hyphen (--) to immediately convert the extracted text strings back into usable numerical values.

1
Extract the latitude value

Select the destination cell where you want the latitude. Assuming your combined text is in cell A2, enter the formula `=--MID(A2,FIND("(",A2)+1,FIND(",",A2,FIND("(",A2))-FIND("(",A2)-1)` and press Enter.

2
Extract the longitude value

Select the adjacent destination cell for longitude. Enter the formula `=--MID(A2,FIND(",",A2,FIND("(",A2))+1,FIND(")",A2)-FIND(",",A2,FIND("(",A2))-1)` and press Enter.

3
Format the coordinate decimal places

Select both of your newly calculated cells, right-click, and choose 'Format Cells'. Navigate to the 'Number' tab and set the decimal places to 6 to ensure standard geographical accuracy.

Extract Coordinates Using MID and FIND Formulas
Understanding the Double Hyphen (--): The double hyphen in front of the MID formula acts as a mathematical operation that converts the text output of the formula into a true number, allowing you to use the coordinates in mapping software or calculations.
Efficient Data Processing

Extract Coordinates Easily in WPS Spreadsheet

WPS Spreadsheet provides flawless compatibility with standard Excel text functions like MID, FIND, and VALUE, allowing you to split complex address strings and manage geographic datasets efficiently.

  1. 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open the spreadsheet containing the address strings with combined coordinates.
  2. 2. Apply the extraction formulas: Click an empty cell next to your data and paste the MID and FIND formulas to extract the latitude and longitude into separate columns.
  3. 3. Use the Fill Handle for bulk extraction: Select the completed formula cells, hover over the bottom-right corner until you see a cross, and drag it down to apply the extraction logic to the rest of your dataset.
Fully compatible with Microsoft Excel formulas and functionsAdvanced text-to-columns tools for quick data separationFree to use for daily spreadsheet processing tasksLightweight application that runs smoothly on most devices
microsoft office alternative - wps office

Frequently Asked Questions

Can I use Text to Columns instead of formulas to separate coordinates?

Yes. You can use the 'Text to Columns' feature under the Data tab. Choose 'Delimited', set the comma as your delimiter, and finish. However, you will still need to use the 'Find and Replace' tool (Ctrl+H) to remove the remaining opening and closing parentheses from your resulting columns.

Why do I get a #VALUE! error when using the MID and FIND formulas?

A #VALUE! error usually occurs if the target cell does not contain the expected parentheses or comma characters. Check your source data to ensure every cell strictly follows the format (latitude, longitude). If a bracket or comma is missing, the FIND function will fail.

How do I format the extracted coordinates to ensure trailing zeros are kept?

Select the cells containing your newly extracted coordinates, press Ctrl+1 to open the Format Cells dialog, go to the Number tab, select 'Number', and explicitly set the decimal places to 6. This prevents the spreadsheet from hiding trailing zeros.