{"id":768,"date":"2014-11-06T06:50:44","date_gmt":"2014-11-06T14:50:44","guid":{"rendered":"http:\/\/blog.ls-al.com\/?p=768"},"modified":"2014-11-06T06:50:56","modified_gmt":"2014-11-06T14:50:56","slug":"sort-ip-address-in-excel","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/sort-ip-address-in-excel\/","title":{"rendered":"Sorting IP addresses in Excel"},"content":{"rendered":"

Sometimes you need to manipulate lists of IP addresses in Excel but of course it sorts on strings which is not ideal for IP addresses. A quick way to sort is adding another column with the following formula and sorting on that new column.<\/p>\n

=((VALUE(LEFT(B6, FIND(\".\", B6)-1)))*256^3)+((VALUE(MID(B6, FIND(\".\", B6)+1, FIND(\".\", B6, FIND(\".\", B6)+1)-FIND(\".\", B6)-1)))*256^2)+((VALUE(MID(B6, FIND(\".\", B6, FIND(\".\", B6)+1)+1, FIND(\".\", B6, FIND(\".\", B6, FIND(\".\", B6)+1)+1)-FIND(\".\", B6, FIND(\".\", B6)+1)-1)))*256)+(VALUE(RIGHT(B6, LEN(B6)-FIND(\".\", B6, FIND(\".\", B6, FIND(\".\", B6)+1)+1))))<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"

Sometimes you need to manipulate lists of IP addresses in Excel but of course it sorts on strings which is<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-768","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/768","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=768"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/768\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=768"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=768"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=768"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}