+ Reply to Thread
Results 1 to 3 of 3

copy column headings of cells with missing data into a single cell

Hybrid View

  1. #1
    Registered User
    Join Date
    06-29-2012
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    2

    copy column headings of cells with missing data into a single cell

    Hi, i want to be able to take the text column headings from a row and compile them into one cell based on the contents of the cells in the row.

    that does not make alot of sence so i have added an attachment.

    This..
    =IF(B2="n",$B$1&", ","")&IF(C2="n",$C$1&", ","")&IF(D2="n",$D$1&", ","")&IF(E2="n",$E$1&", ","")&IF(F2="n",$F$1&", ","")&IF(G2="n",$G$1&", ","")&IF(H2="n",$H$1&", ","")&IF(I2="n",$I$1,"")
    is the solution i have so far but i would like something more elegant which would work for up to 30-40 columns without having to have 30-40 if statements.

    any ideas

    Thanks
    Mat
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-29-2012
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: copy column headings of cells with missing data into a single cell

    ok, since then i have found this macro...
    http://www.cpearson.com/excel/stringconcatenation.aspx

    so if i use that, i can use this formula (entered as array)
    =stringconcat("|",IF(B2:I2="n",B1:I1,""))

    and it works very well.

    however i would really like to be able to do this without using a macro ..........

    Is there any other way?

    thanks
    Mat

  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: copy column headings of cells with missing data into a single cell

    i cant see how unless you did what you were already doing or a version thereof
    Last edited by martindwilson; 07-01-2012 at 12:29 PM.
    "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)

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