+ Reply to Thread
Results 1 to 2 of 2

Populate column from template with data from other columns of same row?

  1. #1
    Registered User
    Join Date
    07-08-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Populate column from template with data from other columns of same row?

    I have an excel product spreadsheet that has features (eight columns for features alone; the number of features per product differs), width, diameter, shackle clearance width and shackle clearance height columns.

    Now, for each of these products, I need a new column that is populated from an html template like the following:

    <style type="text/css">
    h3.descript {
    color: #880000;
    font-family: Georgia, "Times New Roman", Times, serif
    font-weight: normal;
    font-size: 22px;
    margin-bottom: 0.5em;
    }
    table.super {
    text-align: center;
    }
    table.super {
    border-collapse: collapse;
    margin: 0 35px 1em;
    }
    .clear {
    clear: both;
    }
    .abus td {
    width:220px;
    text-align: left;
    padding:5px;
    }
    .abuscat {
    font-weight:bold;
    }

    </style>
    <h3 class="descript">Product Features:</h3>
    <ul>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    </ul>

    <h3 class="descript">Product Specifications:</h3>
    <table class="clear super">
    <tbody class="abus">
    <tr>
    <td><span class="abuscat">Width:</span></td>
    <td>AB160</td>
    </tr>
    <tr>
    <td><span class="abuscat">Shackle Diameter:</span></td>
    <td>Y160</td>
    </tr>
    <tr>
    <td><span class="abuscat">Shackle Clearance - Width:</span></td>
    <td>AA160</td>
    </tr>
    <tr>
    <td><span class="abuscat">Shackle Clearance - Height:</span></td>
    <td>Z160</td>
    </tr>
    </tbody>
    </table>

    As you can see, the only things that need to be rendered into this column dynamically are the values of the <td> elements and the <li> elements.

    Now, the <td>'s should be straightforward enough. My implementation is valid, is it not?

    Just pull from the other columns in the same row.

    But, for the features. Since there are differing numbers for each row (when a feature for a product is not there, that column is just blank [e.g. if product1 has three features, columns feature4-feature8 will be blank]) I'm thinking a for loop of some sort is in order.

    Is this even possible with excel? Surely it is, but I don't know how to accomplish it.

    Also, is the html in the formula going to be a problem? With all of the carrot characters and forward slashes.

    Any help is appreciated!

    Thanks!

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

    Re: Populate column from template with data from other columns of same row?

    post an excel workbook with what you have showing what you want!
    "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