+ Reply to Thread
Results 1 to 2 of 2

Add multiple IF statements to a combined string of cells

  1. #1
    Registered User
    Join Date
    07-16-2008
    Location
    California
    Posts
    3

    Unhappy Add multiple IF statements to a combined string of cells

    I cannot figure out the best way to make this formula as simple as possible so that I don't confuse myself! I have an ecommerce database I'm trying to build in Excel for our website. I have never made a database-driven website before. I'm using Excel 2007. I have no idea how to make a macro, so I'm using a formula. I need to have the text from multiple cells combined together into one cell (I'm using the A3&"-"&A4 type of formula), because I want to have one cell that I can reference from the database to input the product information for a given product.

    The columns have data that I want turned into bullets after the main product description. But if there isn't anything listed in the cell (cell ISBLANK), then I don't want anything to show up for that cell, and I want it to go onto showing the info. for the next cell and so on.

    Here are the Columns I'm using for this formula:

    AP = Item Description
    AQ = Item Info. Bullet #1
    AR = Item Info. Bullet #2
    AS = Item Info. Bullet #3
    AT = Item Info. Bullet #4
    AU = Item Info. Bullet #5
    AW = Warranty (i.e. 1 year or 6 months, etc.)
    AX = Warranty Language (i.e. This is a limited warranty...)
    AZ = UL or ETL Listed
    BA = Wattage

    For some items, collumn AW for Warranty will say "1 year," while for other items this cell is simply blank. Same thing for whether or not the wattage is listed for that product or if it says it is UL listed or just doesn't say.

    Here is my formula so far (the simplified version):

    =CLEAN($AP2&"<ul><b><font face=Arial size=2> <li>"&IF(ISBLANK($AQ2),"",$AQ2&"</li><li>"&$AR2&"</li><li>"&$AS2&"</li><li>"&$AT2&"</li><li>"&$AU2&"</li><li>"&"UL or ETL Listed? "&$AZ2&"</li><li>"&"Watts: "&$BA2&"</li><li>"&"Warranty: "&$AW2&"</li><li>"&"Warranty Language:<br><br>"&$AX2&"</li></font></b></ul>"))

    If I keep it like it is and there isn't any data in cell $AQ2 (Item info. bullet #1), then it doesn't just skip this cell and go onto putting in the info. for the next cell, etc. It just stops there.

    I've also tried the version below, but When I copy & paste this cell info. into my HTML program, I see it is making a "blank" bullet for each cell, even for cells that don't have any data instead of just skipping those cells:


    =CLEAN(IF($AU2="",$AP2&"<ul><b><font face=Arial size=2> <li>"&$AQ2&"</li><li>"&$AR2&"</li><li>"&$AS2&"</li><li>"&$AT2&"</li><li>"&"UL or ETL Listed? "&$AZ2&"</li><li>"&"Watts: "&$BA2&"</li><li>"&"Warranty: "&$AW2&"</li><li>"&"Warranty Language:<br><br>"&$AX2&"</li></font></b></ul>",IF($AW2="",$AP2&"<ul><b><font face=Arial size=2> <li>"&$AQ2&"</li><li>"&$AR2&"</li><li>"&$AS2&"</li><li>"&$AT2&"</li><li>"&"UL or ETL Listed? "&$AZ2&"</li><li>"&"Watts: "&$BA2&"</li><li>"&"Warranty Language:<br><br>"&$AX2&"</li></font></b></ul>",IF($AX2="",$AP2&"<ul><b><font face=Arial size=2> <li>"&$AQ2&"</li><li>"&$AR2&"</li><li>"&$AS2&"</li><li>"&$AT2&"</li><li>"&"UL or ETL Listed? "&$AZ2&"</li><li>"&"Watts: "&$BA2&"</li><li>"&"Warranty: "&$AW2&"</li></font></b></ul>",IF($AZ2="",$AP2&"<ul><b><font face=Arial size=2> <li>"&$AQ2&"</li><li>"&$AR2&"</li><li>"&$AS2&"</li><li>"&$AT2&"</li><li>"&$AU2&"</li><li>"&"Watts: "&$BA2&"</li><li>"&"Warranty: "&$AW2&"</li><li>"&"Warranty Language:<br><br>"&$AX2&"</li></font></b></ul>",IF($BA2="",$AP2&"<ul><b><font face=Arial size=2> <li>"&$AQ2&"</li><li>"&$AR2&"</li><li>"&$AS2&"</li><li>"&$AT2&"</li><li>"&$AU2&"</li><li>"&"UL or ETL Listed? "&$AZ2&"</li><li>"&"Warranty: "&$AW2&"</li><li>"&"Warranty Language:<br><br>"&$AX2&"</li></font></b></ul>",$AP2&"<ul><b><font face=Arial size=2> <li>"&$AQ2&"</li><li>"&$AR2&"</li><li>"&$AS2&"</li><li>"&$AT2&"</li><li>"&$AU2&"</li><li>"&"UL or ETL Listed? "&$AZ2&"</li><li>"&"Watts: "&$BA2&"</li><li>"&"Warranty: "&$AW2&"</li><li>"&"Warranty Language:<br><br>"&$AX2&"</li></font></b></ul>"))))))

    I'd like to be able to use the "ISBLANK" thing or something like it to put an argument for each cell, so that if there isn't anything listed in a cell for "Wattage," then I can make it also not include this part of the formula: &"Watts: "

    I have spent a very long time on this and I cannot figure it out. Please help!!! Thank you so much in advance!

  2. #2
    Registered User
    Join Date
    07-16-2008
    Location
    California
    Posts
    3

    Nevermind - I've got it now.

    Nevermind - I've got it now.

+ 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