+ Reply to Thread
Results 1 to 6 of 6

Formula to compare last octet of ipadress against a defined IP address and return text.

Hybrid View

  1. #1
    Registered User
    Join Date
    11-05-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    15

    Formula to compare last octet of ipadress against a defined IP address and return text.

    Hi,

    I want to compare last octet of IP address against a defined value and return a text value in the adjacent cell.

    Last Octet Location
    0.1 Europe
    0.8 America
    0.9 Asia
    0.1 Australia
    .6, .7, .11, .12 Africa

    Eg: IPaddress is 10.10.10.8 then it should compare the last octet which is .8 and return the value America

    Thanks !!

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula to compare last octet of ipadress against a defined IP address and return text

    Hi,

    Can you clarify whether 0.1 is Europe or Australia? They both have this value in your list.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    11-05-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Formula to compare last octet of ipadress against a defined IP address and return text

    .10 is australia

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula to compare last octet of ipadress against a defined IP address and return text

    The simplest way would be to set up a small table, e.g. with E1:E8 containing 1, 6, 7, 8, 9, 10, 11, 12 and F1:F8 containing Europe, Africa, Africa, America, Asia, Australia, Africa, Africa.

    Then, assuming A1 contains your IP Address:

    =VLOOKUP(--SUBSTITUTE(RIGHT(A1, 2), ".", ), $E$1:$F$8, 2, 0)

    Regards

  5. #5
    Registered User
    Join Date
    11-05-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    15

    Thumbs up Re: Formula to compare last octet of ipadress against a defined IP address and return text

    Great !! It works perfectly fine.

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula to compare last octet of ipadress against a defined IP address and return text

    You're welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Isolating 3rd octet in an IP address
    By ReeceB in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-16-2013, 09:36 PM
  2. Accumulate an IP address, in the last octet by +1
    By bstammer in forum Excel General
    Replies: 7
    Last Post: 04-25-2013, 03:15 PM
  3. [SOLVED] Use TEXT Address result in user defined formula as Range
    By sinoop_joy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-25-2013, 12:09 AM
  4. Replies: 6
    Last Post: 02-28-2013, 11:27 AM
  5. Changing 3rd octet in an IP address
    By ReeceB in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-21-2013, 07:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1