Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert text string to IP address

1,430 views
Skip to first unread message

Mike

unread,
Sep 21, 2009, 6:53:01 PM9/21/09
to
I've got a bunch of text strings similar to this one: 064190119066. Is there
a way to convert this into an IP address in Excel?

Thanks!

Rajesh Mehmi

unread,
Sep 21, 2009, 7:23:46 PM9/21/09
to
Hi

Try the formula below, If your data is in A1
=LEFT(A1,3) &"."& MID(A1,4,3 ) &"."& MID(A1,7,3) &"."& RIGHT(A1,3)


--
Best regards
Rajesh Mehmi
raj...@mehmi.net


"Mike" <Mi...@discussions.microsoft.com> wrote in message
news:E2B298CF-95D1-4A9E...@microsoft.com...

JoeU2004

unread,
Sep 21, 2009, 7:27:55 PM9/21/09
to
"Mike" <Mi...@discussions.microsoft.com> wrote:
> I've got a bunch of text strings similar to this one: 064190119066.
> Is there a way to convert this into an IP address in Excel?

An IP(v4) address is usually presented in "dot notation", composed of 4
parts, each representing one octet. The representation of each octet may or
may not have leading zeros.

So I presume the above is 64.190.119.66. This can be constructed one of two
ways, depending on your preference:

=left(A1,3) & "." & mid(A1,4,3) & "." & mid(A1,7,3) & "." & right(A1,3)

=--left(A1,3) & "." & --mid(A1,4,3) & "." & --mid(A1,7,3) & "."
& --right(A1,3)

The first form yields 064.190.119.066 . The second form yields
64.190.119.66 . Both forms are equally acceptable.

This presumes that you entered the original 12-character string correctly,
either prefixed by an apostrophe (') or in a cell pre-formatted as Text in
order to preserve the leading zero(s).

Ron Rosenfeld

unread,
Sep 21, 2009, 10:02:32 PM9/21/09
to
On Mon, 21 Sep 2009 15:53:01 -0700, Mike <Mi...@discussions.microsoft.com>
wrote:

>I've got a bunch of text strings similar to this one: 064190119066. Is there
>a way to convert this into an IP address in Excel?
>
>Thanks!

Here's one way:

=TEXT(A1,"000\.000\.000\.000")

--ron

0 new messages