How to Extract Latitude and Longitude from an Excel Cell
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.

- 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.
Ensure your source data consistently formats coordinates within parentheses and separates them with a comma. Inconsistent formatting or missing brackets will cause formula errors.
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.
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.
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.
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.

Split Coordinates Using SUBSTITUTE and VALUE
An alternative text manipulation method that substitutes commas and brackets to split the string into manageable parts.
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. Open your dataset in WPS Spreadsheet: Launch WPS Office and open the spreadsheet containing the address strings with combined coordinates.
- 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. 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.

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.




