+ Reply to Thread
Results 1 to 6 of 6

If cell has x turn into number and concatenate

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

    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 07:28 AM.
    Never use Merged Cells in Excel

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

    Re: If cell has x turn into number and concatenate

    Of course, you can change formula at will.

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

    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 06:38 AM.
    "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

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

    Re: If cell has x turn into number and concatenate

    Just after last number

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

    Re: If cell has x turn into number and concatenate

    there you go, add , after every number then remove last character

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

    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)

+ 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