Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IP addresses manipulation in Excel 1

Status
Not open for further replies.

DannyTEM

Technical User
Jul 18, 2002
60
GB
Been trying to find a solution to this one all morning. Have a column of IP's in Excel (for Mac if it makes any difference) and I wanted to shorten them all down to C class level.

I.e

255.255.255.255

becomes

255.255.255

I have played with lots of built in functions but because the last octet can be 1, 2 or 3 numbers long I have not had successful results.

Can anyone suggest a solution? I am thinking some form of regex but I only have very rusty PHP...

Thanks!

DT

Dan Morgan -
 

If only the last three digits can vary, how about:

LEFT(Cell,11)

TomCologne
 
Hi Tom,

Thanks for your reply. Only problem is that the last octet can be 1,2 or 3 numbers long so that solution would only work for some IPs, not all.

Cheers anyway,

DT

Dan Morgan -
 

Hi Dan,

A cold is obviously not only congesting my sinuses...

How about:

=LEFT(A1,FIND(".",A1,9)-1)


TomCologne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top