What I did was paste the list of ip into A1, select that column and performed text to column, specificying a "." delimiter.
Then sort by a,b,c,d highest to lowest.
then in F or another column I put the following formula.
I had seen some other post which had more complex answers and thought this method was better.