How to extract string from IP address in Excel?
If you have a list of IP addresses, and you want to extract the first three characters string only from these IP addresses in Excel, you can do as below tutorial.
Extract character string from IP address by formula
Extract character string from IP address by Text to Column
Extract character string from IP address by Kutools for Excel
Extract character string from IP address
Here I introduce some formulas to extract string based on dot from IP address in Excel.
Select a cell then type one of below formulas as you need.
1. Extract string before first dot
Select a cell and type =MID(A2,1,FIND(".",A2,1)-1), press Enter key then drag the fill handle to the cells you need. See screenshot:
2. Extract string between first and second dots
Select a cell and type =MID(A2,FIND(".",A2)+1,FIND(".",A2,(FIND(".",A2)+1)-FIND(".",A2))-1), press Enter key then drag the fill handle to the cells you need. See screenshot:
3. Extract string between second and third dots
Select a cell and type =MID(A2,FIND(".",A2,FIND(".",A2)+1)+1,FIND(".",A2,FIND(".",A2,FIND(".",A2)+1)+1)-FIND(".",A2,FIND(".",A2)+1)-1), press Enter key then drag the fill handle to the cells you need. See screenshot:
4. Extract string after last dot
Select a cell and type =MID(A2,FIND(".",A2,FIND(".",A2,FIND(".",A2)+1)+1)+1,LEN(A2)-FIND(".",A2,FIND(".",A2,FIND(".",A2)+1)+1)+1), press Enter key then drag the fill handle to the cells you need. See screenshot:
Extract character string from IP address by Text to Column
In Excel, the Text to Column also can quickly extract character string from IP address.
1. Select the IP addresses, and click Data > Text to Columns. See screenshot:
2. In the Convert Text to Columns Wizard dialog, check Delimited option, then click Next and then check Other and type dot sign . into the next textbox in Delimiters section. See screenshot:
3. Click Finish. Then you can see the IP addresses are split by dot sign.
Note:
Using Text to Column will break the original data, you had better copy and paste the original to other location first.
Extract character string from IP address by Kutools for Excel
To split cells by a defined delimiter with Text to Column needed several steps, but if you have Kutools for Excel, you can quickly split character string from IP address by the Split Cells utility.
After free installing Kutools for Excel, please do as below:
1. Select the IP address cells, and click Kutools > Merge & Split > Split Cells. See screenshot:
2. Then in the Split Cells dialog, check Split to Columns, and go to chek Other option and type dot sign . into the textbox under Split by section. See screenshot:
3. Click Ok. And to select a cell to output the result.
4. Click OK. Now the IP address are split by dot.
Extract IP Address From Excel Cell
Relative Articles:
- Extract number only in Excel
- Extract text before/after space/comma in Excel
- Extract duplicates from one column to another column
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!