Extract Octets from IP Address

What formula or set of formulas can I use to extract octets from an IP Address?

Supposing I have in A1 and want 192 in A2, 1 in A3, 2 in A4, and 3 in A5
Who is Participating?
Grasty86Connect With a Mentor Commented:
There is a feature in Excel that can do this for you without any formulas.

Click the Cell containing and then go to Data --> Text to Columns. Then choose Delimited, and specify your own delimiter as a period ".".

From there it will split your octets into columns
You can also add function:
Public Function GetOct(A As String, Oct As Integer) As Integer
' A - IP address, Oct - Octet number from left to right, starting from 0
Dim B() As String
B = Split(A, ".")
GetOct = CInt(B(Oct))
End Function

Open in new window

TechnologyManguAuthor Commented:
Duh me. :) Thank you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.