+ Reply to Thread
Results 1 to 8 of 8

1234 Main ST to 12XX Main St

  1. #1
    Registered User
    Join Date
    03-13-2016
    Location
    Vancouver, BC
    MS-Off Ver
    2016
    Posts
    2

    1234 Main ST to 12XX Main St

    Hello,

    I have address data that I need to edit for privacy. For example: 1234 Main St needs to be 12XX Main St. I also have addresses with <4 digits (300 High St=3XX High St & 95 Jones Blvd=9X Jones Blvd). How do I do this?

    Thank you in advance for your help!!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: 1234 Main ST to 12XX Main St

    Hi, welcome to the forumn

    Maybe this?
    A
    B
    1
    1234 Main St 12XX Main St
    2
    300 High St 3XX High St
    3
    95 Jones Blvd 9XX Jones Blvd

    B1=LEFT(A1,IF(SEARCH(" ",A1)>=5,2,1))&"XX"&MID(A1,SEARCH(" ",A1),99)
    copied down
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,913

    Re: 1234 Main ST to 12XX Main St

    A slight variation on Ford's formula.
    It does almost the same thing, except it will 95 into 9X rather than 9XX. (Yes, just me being pedantic! )

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    BSB

  4. #4
    Registered User
    Join Date
    03-13-2016
    Location
    Vancouver, BC
    MS-Off Ver
    2016
    Posts
    2

    Talking Re: 1234 Main ST to 12XX Main St

    THANK YOU THANK YOU THANK YOU!! So glad I found this resource

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: 1234 Main ST to 12XX Main St

    Neither of those suggestions will censor a single digit, but this one will.

    =REPLACE(A1,1,FIND(" ",A1)-1,LEFT(LEFT(A1,(FIND(" ",A1)-1)/2)&"XX",FIND(" ",A1)-1))

    Will also work with more than 4 digits by increasing the number of X's in the formula.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: 1234 Main ST to 12XX Main St

    Happy to help, thanks for the feedback

    @ Jason, nicely done

  7. #7
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,835

    Re: 1234 Main ST to 12XX Main St

    Of course, if you don't replace all the strings with an output string that is the same length regardless of the number of digits in the address, you're not gaining much in privacy. That said, if you're outputting the street name, in most cases hiding/obfuscating part or all of the house number doesn't provide much privacy anyway. The process merely provides the illusion of privacy.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  8. #8
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: 1234 Main ST to 12XX Main St

    Quote Originally Posted by macropod View Post
    in most cases hiding/obfuscating part or all of the house number doesn't provide much privacy anyway.
    I was thinking similarly, but the OP appeared to know what they needed. I would have thought that if this was to meet any kind of data protection requirement that there would be some guidelines to say what is or isn't acceptable.

    Remembering that this is being done with a formula, the original, uncensored address string will still be clearly visible, either in an adjacent cell, with formula evaluation, or simply by editing the formula, there is no actual privacy at all. If anything, I would guess that this could be just for demonstration purposes, maybe a schoolteacher doing a classroom demonstration, but it's too early in the day for mind reading, so that's purely speculation.

    Not everything requires the same level of security, if it did, hardware stores wouldn't carry such a wide variety of locks.
    Last edited by jason.b75; 03-14-2016 at 06:21 AM.

+ 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. Main Menu
    By inteliits in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-25-2015, 07:29 PM
  2. Main information row with sub row
    By swhitesell in forum Excel General
    Replies: 2
    Last Post: 10-29-2012, 12:36 PM
  3. to exit main procedure from procedure called by yhe main
    By kmlprtsngh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-27-2010, 02:46 PM
  4. updating main sheet
    By nsnvc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-10-2009, 06:30 AM
  5. Update the main Tab
    By gaby58 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2008, 06:14 PM
  6. [SOLVED] Main first
    By Jenni_Sweden in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-15-2006, 06:15 AM
  7. Main Menu
    By Syed Haider Ali in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-24-2005, 02:58 AM

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