Skip to main content

Kutools for Office — One Suite. Five Tools. Get More Done.

How to extract string from IP address in Excel?

Author Sun Last modified

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 Kutools for Excel good idea3

Extract character string from IP address by Text to Column


arrow blue right bubble 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:
use a formula to extract string before first dot

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:
use a formula to extract string  between first and second dots

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:
use a formula to extract string  between second and third dots

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:
use a formula to extract string after last dot


arrow blue right bubble 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.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

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:
click Split Cells feature of kutools

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:
specify options in the dialog box

3. Click Ok. And to select a cell to output the result.
select a cell to output the result

4. Click OK. Now the IP address are split by dot.
the IP address are split by dot


arrow blue right bubble 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:
click Data > Text to Columns

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:

check Delimited option
arrow down
check Other and type dot sign

3. Click Finish. Then you can see the IP addresses are split by dot sign.

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.

Demo: Extract IP Address From Excel Cell

 

Relative Articles:

Best Office Productivity Tools

šŸ¤– Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions…
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

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!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

Excel Word Outlook Tabs PowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in