r/excel • u/Rupispupis • Dec 14 '16
solved Isolating middle IP octets.
Example:
172.20.130.24
10.140.24.154
How can I go about extracting the 3rd octet. The problem is, last octet can be 2 or 3 digits, so I can't use RIGHT. And the 3rd octet itself can be 2 or 3 digits.
2
Upvotes
1
u/excelevator 3071 Dec 14 '16
Another Alternative..
2
u/itsnotaboutthecell 119 Dec 14 '16 edited Dec 14 '16
Try this - the 2nd period always starts at the 7th digit.
2
u/excelevator 3071 Dec 14 '16 edited Dec 15 '16
A neater option, UDF.
Open VBA editor (alt +F11) > Insert Module > Paste Code below
Use:
=SplitIt ( cell , delimter , return_element )1
u/12V_man 222 Dec 14 '16
will work but by the time I got done writing that tangled monstrosity out, I saw u/itsnotaboutthecell has produced a much cleaner solution.