+ Reply to Thread
Results 1 to 10 of 10

"Masking" out non alpha characters from a string

  1. #1
    Registered User
    Join Date
    09-28-2007
    Posts
    14

    Angry "Masking" out non alpha characters from a string

    I am comparing to columns of data from MS Project using Excel. In one column are the resource names for the project tasks. In addition to the names are the designations for % utilized. So the column's data will look like this:
    John Jones[15%],Mary Smith, Fred Arguello[240%].

    I want to compare this column with another resource names column which will never have utilization values - only the names.

    In order to do that I need to "mask" the non alpha characters out of the first string.

    Any thoughts on how this can be accomplished?

    -denise

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: "Masking" out non alpha characters from a string

    Perhaps =LEFT(A1, FIND("[", A1)-1)
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    09-28-2007
    Posts
    14

    Re: "Masking" out non alpha characters from a string

    That will only get the first one. I could use VBA but if there is a single pass command that would take non alpha and make is a space then I can just put a Trim in front of it.

    Thank you for your quick response though!

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: "Masking" out non alpha characters from a string

    Maybe Ctrl+H
    replace what [
    with (nothing)

    same for ]

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: "Masking" out non alpha characters from a string

    That's all a string in a single cell?

    What do you want the output to be?

    EDIT: Replace [*] with nothing
    Last edited by shg; 07-20-2009 at 03:45 PM.

  6. #6
    Registered User
    Join Date
    09-28-2007
    Posts
    14

    Re: "Masking" out non alpha characters from a string

    Example:

    Cell 1 contains: Mary Jones[85%], Max Smith, John James[125%]
    Cell 2 contains: Mary Jones, Max Smith, John James

    For purposes of what I am doing, I want Excel to see them as equal.
    They would not be equal if any of the names were different.

    So, I am looking for a way to pass the Cell 1 data through a filter/mask that will convert anything non-alpha to space then I can put Trim in front of it. (or something comparable)

    i.e, Trim(Cell1,"aaaa,aaaa,aaaa")

    Similar to the way you define numeric formatting (##.#) etc.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: "Masking" out non alpha characters from a string

    Select the column, Replace[*] with nothing

  8. #8
    Registered User
    Join Date
    09-28-2007
    Posts
    14

    Re: "Masking" out non alpha characters from a string

    That won't work in an equation....

    If(Cell2=Trim(Cell1,"aaaa,aaaa,aaa"),x,y) etc.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: "Masking" out non alpha characters from a string

    Do the find and resplace first.

    I don't know what your equation is supposed to do. Trim only takes one argument.

    An example workbook would, as usual, help.

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

    Re: "Masking" out non alpha characters from a string

    a formula solution is to use the morefunc add in
    http://xcell05.free.fr/morefunc/english/
    and use
    =REGEX.SUBSTITUTE(A1,"[\[{0-9}%\]]")
    "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

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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