+ Reply to Thread
Results 1 to 19 of 19

IP address - thousands separator are displayed but excel thinks it is a normal number

  1. #1
    Registered User
    Join Date
    10-12-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Question IP address - thousands separator are displayed but excel thinks it is a normal number

    Heyho cool people out there!

    I have got a big issue with Excel. I am using version 2010.

    I have an IP-Reporting with roughly 10.000 IP-addresses.

    Roughly 90% of these addresses are shown as e.g. 92.158.121.124 in the cell and in the bar at the top. The other 10% are also shown like real addresses in the cells BUT in the bar at top top the dots are missing.
    For example 92.251.155.134 in the cell but 92251155134 in the bar at the top.

    The problem is that Excel "thinks" that it deals with normal numbers and so it shows the thousands separators in the cells (not in the bar).
    Because of this I can not spilt that kind of IP-addresses into different colums. Is there an opportunity to format these numbers into IP-addresses so the dots of the number would not just appear in the cell but also in the bar.

    It gets more complicated when the IP address is "shorter" like: 95.57.1.68
    So the number in the bar is: 9557168 ..I would like to see the number as 95.57.1.68 And I would like to split the number at each point into another colum ('split data' option in Excel).

    I tried some formula but it didn't really work out. And just changing the format didn't work out too.

    Thanks for any useful hints people!

    All the best!
    John
    Last edited by john_kaufi; 10-12-2011 at 12:07 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    If you right click on any of those cells and go to Format Cells, then Number tab. What is the actual selected format? If Custom, what is in the Type field?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    10-12-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    Hi NBVC!

    Thanks for replying that fast!

    The cell formats:

    For IPs that I need to change the format is "Number" with thousands separators turn on.
    For IPs that I don't need to change the format is "Standard".

    This already existed when I opened the xls the first time.

    Thanks!

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    It sounds like Excel has tried to determine the best data type automatically when the IP addresses were loaded.

    On the plus side all of the shorter IP addresses must be of type standard, otherwise they wouldn't appear correctly. For example, 95.57.1.68 as a number would be 9557168, which the thousands separator would parse as 9.557.168. This means that all of the ones of number type must be in the format (xx)x.xxx.xxx.xxx

    Can you confirm that?

  5. #5
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    Hello

    I'll quote your post
    Because of this I can not split that kind of IP-addresses into different colums. Is there an opportunity to format these numbers into IP-addresses so the dots of the number would not just appear in the cell but also in the bar.

    I think you should turn all your ip to texts then you can split them into different columns using TEXT to COLUMN found in the ribbon.

  6. #6
    Registered User
    Join Date
    10-12-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    Hey guys!

    @Andrew-R:
    You are right that is the case. For example:

    92.158.121.124 (cell) --> 92158212124 (bar)
    222.157.126.222 (cell) --> 222157126222 (bar)
    85.181.0.176 (cell) --> 85.181.0.176 (bar)
    84.44.248.254 (cell) ---> 84.44.248.254 (bar)

    It seems that Excel interprets all IPs that have got 9 numbers (from back to front) *.XXX.XXX.XXX as numbers.

    If an IP is XXX.XX.X.XXX or X.X.XXX.XXX or XX.XXX.XX.XXX Excel does interpret it right.

    @vlady: When I turn the pertaining cells to "Text" Excel just produces a normal number as text, without dots. I already tried that.
    Last edited by john_kaufi; 10-13-2011 at 06:00 AM.

  7. #7
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    In that case, you can use this knowledge to create the following formulae to split to columns:

    In B2 to B5, assuming IP address is in A2
    =IF(ISTEXT(A2),LEFT(A2,SEARCH(".",A2)-1),LEFT(A2,LEN(A2)-9))

    =IF(ISTEXT(A2),IF(MID(A2,LEN(B2)+3,1)=".",MID(A2,LEN(B2)+2,1),IF(MID(A2,LEN(B2)+4,1)=".",MID(A2,LEN(B2)+2,2),MID(A2,LEN(B2)+2,3))),RIGHT(LEFT(A2,LEN(A2)-6), 3))

    =IF(ISTEXT(A2),IF(MID(A2,LEN(B2)+LEN(C2)+4,1)=".",MID(A2,LEN(B2)+LEN(C2)+3,1),IF(MID(A2,LEN(B2)*LEN(C2)+5,1)=".",MID(A2,LEN(B2)+LEN(C2)+3,2), MID(A2,LEN(B2)+LEN(C2)+3,3))),RIGHT(LEFT(A2,LEN(A2)-3),3))

    =IF(ISTEXT(A2),IF(MID(A2,LEN(A2)-1,1)=".",RIGHT(A2,1),IF(MID(A2,LEN(A2)-2,1)=".",RIGHT(A2,2),RIGHT(A2,3))),RIGHT(A2,3))

  8. #8
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    OK, so if your current addresses are in column A, starting in row 1, then in cell B1 you can put the formula =IF(ISNUMBER(A1),SUBSTITUTE(TEXT(A1,"#,###"),",","."),A1) and copy that all of the way down.

    That should put everything in the proper format in column B, you can now copy that column, use Paste Special|Values to overwrite that formula with the value returned and then delete column A. Job done.

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    i work with hundreds of spread sheets with ip addresses on and never have that problem
    it could happen if your thousand separator is set as full stop instead of comma in regional settings tho..
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  10. #10
    Registered User
    Join Date
    10-12-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    Hi guys!

    Sorry for answering that late, but I didn't have time earlier.

    @Andrew-R: Your "formula looks great. But somehow it doesn't work. I am not really good in Excel, especially when it is dealt with formulas. ..Could the problem be that I am using a German version of Windows 7? My Office is English but does support German too. I know the problem of "," and ".".

    I attached a screenshot of the formula. Should I use a semicolon instead of the comma?

    @ martindwilson: I got the Excel sheet from the Google Dart Team in Ireland. Is there anything I can try to surpass the problem you described? In Excel my decimal separator is "," and my thousands separator is "." It is set to use the system settings but when I am right then these are the right separators for my area. Should I exchange them?

    Greetings guys!

    All the best!
    Johannes
    Attached Images Attached Images

  11. #11
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    Yes, *some* of the commas need to be semi-colons, and one of the things you've entered as a comma is actually a full-stop. The formula should be =IF(ISNUMBER(A1);SUBSTITUTE(TEXT(A1;"#,###");",";".");A1)

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    london? then correct separator is , for 1000 . for decimal
    i think you need to decide what is the priority for your regional settings!
    however when you import them to excel
    set the field to text in the import wizard that should do it
    don't just copy paste
    put the raw data into notepad and import that
    Last edited by martindwilson; 10-20-2011 at 05:55 PM.

  13. #13
    Registered User
    Join Date
    10-12-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    Hi Andrew-R!

    Thanks for your answer. But when I use the code then the numbers are pure text without the dots in between. ..But I need the dots in between.

    Greetings and thanks

  14. #14
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    what london are you in?

  15. #15
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    John,

    If it's not putting the dots in then it's not recognising the field as numbers. You could try changing my fomula to: =IF(NOT(ISERROR(VALUE(A1)));SUBSTITUTE(TEXT(VALUE(A1);"#,###");",";".");A1)

  16. #16
    Registered User
    Join Date
    01-16-2013
    Location
    amsterdam
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    Hi john_kaufi,

    thanks for starting this thread, certainly helped me a lot!

    I encountered the same problem and I followed the suggestion of martindwilson below.

    then correct separator is , for 1000 . for decimal
    i think you need to decide what is the priority for your regional settings!
    The problem is with regional setting, I think because you use "." for both decimal and thousand separator. Once I changed my decimal setting to "." and my thousand separator to "," the problem is solved.

    Thanks again guys!

    Max

  17. #17
    Registered User
    Join Date
    04-25-2014
    Location
    Costa Rica
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: IP address - thousands separator are displayed but excel thinks it is a normal number

    I had the same problem but I find an easy fix. Just copy all of your IPs on a notepad >> Open an excel sheet and select for example Column A >> Edit format and select all to "Text" >> Copy all the IPs from your Notepad >> Go back to your spreadsheet, select the column A again, right click, paste special and select text again.

    It will paste all your IPs keeping the format with the dots (.) then you can use text in columns to separate every block of #s

    Hope this is helpful!

  18. #18
    Registered User
    Join Date
    11-30-2017
    Location
    Europe, World
    MS-Off Ver
    2016
    Posts
    1

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    Quote Originally Posted by Andrew-R View Post
    OK, so if your current addresses are in column A, starting in row 1, then in cell B1 you can put the formula =IF(ISNUMBER(A1),SUBSTITUTE(TEXT(A1,"#,###"),",","."),A1) and copy that all of the way down.

    That should put everything in the proper format in column B, you can now copy that column, use Paste Special|Values to overwrite that formula with the value returned and then delete column A. Job done.
    I registered just to say thank you for this post. Had a list of over a million IPs that were full of commas, and you just made my life easier. Internet kuddos, big time

  19. #19
    Registered User
    Join Date
    05-27-2023
    Location
    Copenhagen, Denmark
    MS-Off Ver
    365
    Posts
    1

    Re: IP address - thousands separator are displayed but excel thinks it is a normal nu

    Quote Originally Posted by martindwilson View Post
    i work with hundreds of spread sheets with ip addresses on and never have that problem
    it could happen if your thousand separator is set as full stop instead of comma in regional settings tho..
    Thank you, thank you, thank you I have worked for days,asking colleagues and ChatGPT and i got nowhere with formating in Excell - THIS was my issue, the dot instead of the comma in regional settings. Thank you! ! !

    JanV

+ 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