Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

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 good idea3


Split Cells (split a cell into multiple columns to multiple rows based on a separator or fixed width.)


doc split cell

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.

formula Never need to worry about long long formulas in Excel anymore! Kutools for Excel's Auto Text can add all formulas to a group
as auto text, and liberate your brain! Click here to know Auto Text     Click here to get free trial

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:
doc-extract-string-from-ip-1

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:
doc-extract-string-from-ip-2

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:
doc-extract-string-from-ip-3

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:
doc-extract-string-from-ip-4


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:
doc-extract-string-from-ip-5

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:

doc-extract-string-from-ip-6
doc-arrow
doc-extract-string-from-ip-7

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

doc-extract-string-from-ip-8

Note:

Using Text to Column will break the original data, you had better copy and paste the original to other location first.


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, with more than 120 handy Excel functions, enhance your working efficiency and save your working time.

After free installing Kutools for Excel, please do as below:

1. Select the IP address cells, and click Kutools > Text > Split Cells. See screenshot:
doc extract string from ip 9

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:doc extract string from ip 14

3. Click Ok. And to select a cell to output the result.
doc extract string from ip 13

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

pay attention1If you are interested in this addi-in, download the 60-days free trial.

Exctract Email Address 

Kutools for Excel's Extract Email Address utility can quickly extract all email addresses from text strings to another location.
doc extract email address

Relative Articles:


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    unknown2048 · 4 years ago
    Little formula correction for the "Extract string between first and second dots" to handle bug when there is only one characters between the first & second dot:

    =MID(B2; FIND(".";B2)+1; (FIND("."; B2; (FIND("."; B2)+1)) - (FIND("."; B2)+1)))
    • To post as a guest, your comment is unpublished.
      Hershy Heilpern · 1 months ago
      same here just came back to write the correction and saw this

      my correction was actually a little different
      =MID(A2,FIND(".",A2)+1,FIND(".",A2,(FIND(".",A2)+1))-FIND(".",A2)-1)
    • To post as a guest, your comment is unpublished.
      Stephen Coury · 2 months ago
      Yes. I wish I had seen your correction before I spent a full day coming up with the same solution for one or two characters between the first and second dots. I didn't see your note until I thought I should post that there is a bug and scrolled down to see that you found it 3 years ago!!