+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Forum Guru zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    5,726

    If cell has x turn into number and concatenate

    Example is in the attch:

    Book11.xls

    This formula works but if there is no number 4 then I don't want comma after 1, or 2, or 3,

    How avoid it:

    results

    1,2,3,4
    1,2,
    1,2,3,
    3,4
    1,
    4
    2,3,

    (red , need to be removed)
    Last edited by zbor; 07-04-2009 at 08:28 AM.
    "Relax. What is mind? No matter. What is matter? Never mind!"

  2. #2
    Forum Guru zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    5,726

    Re: If cell has x turn into number and concatenate

    Of course, you can change formula at will.
    "Relax. What is mind? No matter. What is matter? Never mind!"

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

    Re: If cell has x turn into number and concatenate

    take the , out of the formula?
    oh i see you want 1,2 and 1,2,3
    but no trailing ,
    =LEFT(IF(A2="x","1,","")&IF(B2="x","2,","")&IF(C2="x","3,","")&IF(D2="x","4,",""),LEN(IF(A2="x","1," ,"")&IF(B2="x","2,","")&IF(C2="x","3,","")&IF(D2="x","4,",""))-1)
    there must be a shorter way tho.
    Last edited by martindwilson; 07-04-2009 at 07:38 AM.
    Mojito connoisseur and a dabbler in Cisco
    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

  4. #4
    Forum Guru zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    5,726

    Re: If cell has x turn into number and concatenate

    Just after last number
    "Relax. What is mind? No matter. What is matter? Never mind!"

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

    Re: If cell has x turn into number and concatenate

    there you go, add , after every number then remove last character
    Mojito connoisseur and a dabbler in Cisco
    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

  6. #6
    Forum Guru zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    5,726

    Re: If cell has x turn into number and concatenate

    I figure it out during lunch

    =LEFT(IF(A3="x";"1,";"")&IF(B3="x";"2,";"")&IF(C3="x";"3,";"")&IF(D3="x";"4";"");2*COUNTA(A3:D3)-1)
    "Relax. What is mind? No matter. What is matter? Never mind!"

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.2.0