+ Reply to Thread
Results 1 to 7 of 7

List of IPs in Column A, need country of origin in column B

  1. #1
    Registered User
    Join Date
    08-04-2009
    Location
    Morgantown, wv
    MS-Off Ver
    Excel 2007
    Posts
    6

    List of IPs in Column A, need country of origin in column B

    I have a list of IPs that have attacked a certain site over the past year. There are 3000 different IPs, so I would like to automate this. Is there a way to code a lookup on an IP to match its country of origin?

    EX:
    Coumn A Column B

    216.34.131.135 Australia


    Thank you!
    Whinston
    Last edited by whinston; 12-04-2009 at 02:52 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: List of IPs in Column A, need country of origin in column B

    If you have an IP in D1, you can find it in the existing list like so:

    =INDEX(B:B, MATCH(D1, A:A, 0))

    That will return the country if found or an error if no match.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-04-2009
    Location
    Morgantown, wv
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: List of IPs in Column A, need country of origin in column B

    JB,
    Thank you!


    [SOLVED]
    Last edited by whinston; 12-04-2009 at 02:46 PM.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: List of IPs in Column A, need country of origin in column B

    You don't need to see the "end range" value because the beginning of the NEXT range indicates the previous range has ended.

    INDEX/MATCH can do "fuzzy matches" like this, too, just change the last parameter to "1". Anytime an exact match is not found, it will return the value from the closest value in the table LOWER then the one you're searching.

    =INDEX(B:B, MATCH(D1, A:A, 1))

  5. #5
    Registered User
    Join Date
    08-04-2009
    Location
    Morgantown, wv
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: List of IPs in Column A, need country of origin in column B

    THANK YOU!

    [SOLVED]

    Whinston
    Last edited by whinston; 12-04-2009 at 02:47 PM.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: List of IPs in Column A, need country of origin in column B

    Just make sure the MATCH column data is sorted ascending to get the correct answers.
    ========

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: List of IPs in Column A, need country of origin in column B

    Your post does not comply with Rule 5 of our Forum RULES. We have Seven question forums: Miscellaneous, General, Programming, Worksheet Functions, Charting, Excel 2007 Help and New Users. Please choose the appropriate forum, and post your question in ONLY one forum.

    Moved to functions Forum
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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