+ Reply to Thread
Results 1 to 6 of 6

Subtracting One String from Another

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    5

    Subtracting One String from Another

    I have two columns of data that represent days of the week. One column holds all the possible days of the week that a route can be run such as "MTRFS" or "MTWRF." The other column includes days that a route cannot run such as "TFS" or "M." I am trying to come up with another column that will subtract the cell from the days that a route cannot run column from a cell in the possible days column. Is it possible to subtract one string from another like this?

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,058

    Re: Subtracting One String from Another

    Can you upload example workbook with your input and desired output?
    Never use Merged Cells in Excel

  3. #3
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Subtracting One String from Another

    Shouldn't Days_Route_Can_Run - Days_Route_Cannot_Run = Days_Route_Can_Run? Seems like there should be no common day between when it can and when it cannot be run (i.e. mutually exclusive).

    Pauley

  4. #4
    Registered User
    Join Date
    04-02-2012
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Subtracting One String from Another

    Weekday Issue.xlsx

    See above attachment for Input and Output examples. Yes the final column will be mutually exclusive. That's why I'm trying to do some sort of "String Subtraction." This is only my first thought. If anyone has any other suggestions then I'd greatly appreciate them

  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: Subtracting One String from Another

    If you can use a UDF,

    Please Login or Register  to view this content.
    E.g., =StrSub("MTRFS","TFS") returns MR
    Last edited by shg; 04-02-2012 at 07:32 PM.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    04-02-2012
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Subtracting One String from Another

    Thank you. This solution works perfectly.

+ 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