+ Reply to Thread
Results 1 to 7 of 7

Help with string concatenation logic

  1. #1
    Registered User
    Join Date
    09-13-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    5

    Help with string concatenation logic

    Hello i have a issue in terms of logic:

    a.JPG

    I have these fields that i want to concatenate in a string
    Each one depends on each other for instance "VIP O2 MET EXAM - "

    Examples:
    If it is VIP then "VIP - " but if it is VIP and EXAM then "VIP EXAM - "
    If it is O2 then "O2 - " but if it is also Metropolis then " O2 Metropolis - "
    If it is none " - "

    I've been going around and around with this and my head already hurts :S Can someone help me with this logic? Or an alternative?

    The function is like the following
    Please Login or Register  to view this content.
    I would appreciate the help a lot if you could help

    Cheers.

  2. #2
    Registered User
    Join Date
    10-25-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2007
    Posts
    71

    Re: Help with string concatenation logic

    Some examples of what you want you want would assist us assist you. In other words, post a small sample of example data you want to look through and want you want the result to be.

  3. #3
    Registered User
    Join Date
    09-13-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help with string concatenation logic

    Quote Originally Posted by swhitesell View Post
    Some examples of what you want you want would assist us assist you. In other words, post a small sample of example data you want to look through and want you want the result to be.
    I use the excel sheet to create ticket's title that i create

    This is a data sample:
    A B C D E F
    25 TEAM* TEAM
    26 COOS? YES 2G 00 3G 03
    27 VIP? YES
    28 O//? YES
    29 Metropolis? No
    30 EXAM? YES
    31 TECHNOLOGY* 2G & 3G
    32 NETWORK ELEMENT* 01234
    33 Site Owner? V// Host
    34 Co-owner Site Ref. 00002
    35 Co-owner TT 123456
    36 ISSUE TYPE? Hardware Issue (COOS = YES)
    37 ALARM Alarm Example(ONLY IF COOS = NO)

    Result:
    E// - COOS 2G:00 3G:03 - VIP O// EXAM - TEAM - V// 01234 - V// Host - O// 00002 - O// TT 123456 - Hardware Issue


    Data Sample #2
    A B C D E F
    25 TEAM* TEAM
    26 COOS? NO 2G 00 3G 00
    27 VIP? No
    28 O//? YES
    29 Metropolis? YES
    30 EXAM? No
    31 TECHNOLOGY* 2G & 3G
    32 NETWORK ELEMENT* 04567
    33 Site Owner? O// Host
    34 Co-owner Site Ref. 00099
    35 Co-owner TT 876543
    36 ISSUE TYPE? Hardware Issue (COOS = YES)
    37 ALARM Alarm Example (ONLY IF COOS = NO)

    Result:
    E// - O// MET - TEAM - V// 01234 - O// Host - O// 00099 - O// TT 876543 - Alarm Example

    I have only the issue with the B27 to B30

    Following the example above: If any of those fields are set to no basically it won't have any to show but this
    E// - TEAM - V// 01234 - O// Host - O// 00099 - O// TT 876543 - Alarm Example

    If EXAM is YES:
    E// - EXAM - TEAM - V// 01234 - O// Host - O// 00099 - O// TT 876543 - Alarm Example

    If Metropolis is YES:
    E// - MET - TEAM - V// 01234 - O// Host - O// 00099 - O// TT 876543 - Alarm Example

    If O// is YES:
    E// - O// - TEAM - V// 01234 - O// Host - O// 00099 - O// TT 876543 - Alarm Example

    If VIP is YES:
    E// - VIP - TEAM - V// 01234 - O// Host - O// 00099 - O// TT 876543 - Alarm Example

    If all is YES:
    E// - VIP O// MET EXAM - TEAM - V// 01234 - O// Host - O// 00099 - O// TT 876543 - Alarm Example


    Please Login or Register  to view this content.
    If you need any more examples please do say. I'm very sorry but i can't give you the sheet because this is for my company.

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

    Re: Help with string concatenation logic

    it might be easier if you attached an actual sample workbook!
    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    "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

  5. #5
    Registered User
    Join Date
    09-13-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help with string concatenation logic

    Quote Originally Posted by martindwilson View Post
    it might be easier if you attached an actual sample workbook!
    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic


    It is attached.
    Attached Files Attached Files

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

    Re: Help with string concatenation logic

    well a few examples on the sheet would help.
    i for one am not going to try and get this in your sheet,
    This is a data sample:
    A B C D E F
    25 TEAM* TEAM
    26 COOS? YES 2G 00 3G 03
    27 VIP? YES
    28 O//? YES
    29 Metropolis? No
    30 EXAM? YES
    31 TECHNOLOGY* 2G & 3G
    32 NETWORK ELEMENT* 01234
    33 Site Owner? V// Host
    34 Co-owner Site Ref. 00002
    35 Co-owner TT 123456
    36 ISSUE TYPE? Hardware Issue (COOS = YES)
    37 ALARM Alarm Example(ONLY IF COOS = NO)

    Result:
    E// - COOS 2G:00 3G:03 - VIP O// EXAM - TEAM - V// 01234 - V// Host - O// 00002 - O// TT 123456 - Hardware Issue


    Data Sample #2
    A B C D E F
    25 TEAM* TEAM
    26 COOS? NO 2G 00 3G 00
    27 VIP? No
    28 O//? YES
    29 Metropolis? YES
    30 EXAM? No
    31 TECHNOLOGY* 2G & 3G
    32 NETWORK ELEMENT* 04567
    33 Site Owner? O// Host
    34 Co-owner Site Ref. 00099
    35 Co-owner TT 876543
    36 ISSUE TYPE? Hardware Issue (COOS = YES)
    37 ALARM Alarm Example (ONLY IF COOS = NO)

    Result:
    E// - O// MET - TEAM - V// 01234 - O// Host - O// 00099 - O// TT 876543 - Alarm Example

    I have only the issue with the B27 to B30

    Following the example above: If any of those fields are set to no basically it won't have any to show but this
    E// - TEAM - V// 01234 - O// Host - O// 00099 - O// TT 876543 - Alarm Example

    If EXAM is YES:
    E// - EXAM - TEAM - V// 01234 - O// Host - O// 00099 - O// TT 876543 - Alarm Example

    If Metropolis is YES:
    E// - MET - TEAM - V// 01234 - O// Host - O// 00099 - O// TT 876543 - Alarm Example

    If O// is YES:
    E// - O// - TEAM - V// 01234 - O// Host - O// 00099 - O// TT 876543 - Alarm Example

    If VIP is YES:
    E// - VIP - TEAM - V// 01234 - O// Host - O// 00099 - O// TT 876543 - Alarm Example

    If all is YES:
    E// - VIP O// MET EXAM - TEAM - V// 01234 - O// Host - O// 00099 - O// TT 876543 - Alarm Example

  7. #7
    Registered User
    Join Date
    09-13-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help with string concatenation logic

    Sorry i altered at that time the string(company issues):
    EDIT:
    @martindwilson: I already have the code for the part, i'm just having some issues with it:
    Please Login or Register  to view this content.
    This is the code for the part i want to work on but there is always a space or a " - " appearing

    I don't need a total code of this, just for a little help in the logic of cells B27:B30 to make them dependant on each other.


    Please Login or Register  to view this content.
    Result:
    ANOC - COOS 2G:00 3G:03 - VIP O// EXAM - TEAM - V// 01234 - V// Host - O// 00002 - O// TT 123456 - Hardware Issue


    Please Login or Register  to view this content.
    Result:
    ANOC - O2 MET - TEAM - VDF 01234 - O2 Host - O2 00099 - O2 TT 876543 - Alarm Example

    I have only the issue with the B27 to B30

    Following the example above: If any of those fields are set to no basically it won't have any to show but this
    ANOC - TEAM - VDF 01234 - O// Host - O// 00099 - O2 TT 876543 - Alarm Example

    If EXAM is YES:
    ANOC - EXAM - TEAM - VDF 01234 - O// Host - O2 00099 - O2 TT 876543 - Alarm Example

    If Metropolis is YES:
    ANOC - MET - TEAM - VDF 01234 - O// Host - O2 00099 - O2 TT 876543 - Alarm Example

    If O// is YES:
    ANOC - O2 - TEAM - VDF 01234 - O// Host - O2 00099 - O2 TT 876543 - Alarm Example

    If VIP is YES:
    ANOC - VIP - TEAM - VDF 01234 - O// Host - O2 00099 - O2 TT 876543 - Alarm Example

    If all is YES:
    ANOC - VIP O2 MET EXAM - E// - VDF 01234 - O2 Host - O2 00099 - O// TT 876543 - Alarm Example
    Last edited by Nahkranoth; 03-16-2013 at 08:15 AM.

+ 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