+ Reply to Thread
Results 1 to 5 of 5

Present data from a binary table

  1. #1
    Registered User
    Join Date
    02-18-2010
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    2

    Present data from a binary table

    Hi guys!

    Im currently working on my master thesis and i hope you can help me on a excel issue.
    We are doing an optimization model for a brewery where the output we get is a table with binary values (representing wether to produce a chosen product in a chosen week).
    Weeks is in the columns, the products in the rows.
    (See the gdoc spreadsheet, INPUT)

    What i want to be able to do is to show the products the model chooses to produce presented under the weeks chronologically, like i have written in the gdoc spreadsheet under TO SHOW.
    Im not sure what kind of coding is needed for this, but i think you might.

    Google docs spreadsheet:
    http://spreadsheets.google.com/ccc?k...pTXFjZmc&hl=en

    Thanks in advance,
    Alexander

  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: Present data from a binary table

    why not attach an excel workbook ? instead of a link to google docs?
    "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

  3. #3
    Registered User
    Join Date
    02-18-2010
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Present data from a binary table

    Oh, i thought it might be easier to access it.
    I`ll attach the same type of setup here as an excel-file.

    Hope somebody out there is able to help.

    Alexander

    Example.xls

  4. #4
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Present data from a binary table

    As you are on your master's thesis I will give you a few pointers.

    (possible) the easiest way is to use VBA.

    When you change the value of a cell the event
    Please Login or Register  to view this content.
    is fired.
    This code exists in the worksheet module NOT in a separate code module.

    You can then use the range Target to determine whether it is an appropriate cell that has changed (and do some validation)

    Then from the target.row and target.column and value of target you can identify whether a particular combination should appear in your list.

    If you have all combination of week and product then it is easy to calculate which line is for a week/product and then hide/unhide the row.


    ----
    you could also use (hidden) rows and columns to hold values for the weeks and productsand do lookups. rather than fixed value calculations.


    hope this helps


    click on the * Add Reputation if this was useful or entertaining.

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Present data from a binary table

    Depends how rigid your output layout is.

    This array formula, commit with CTRL+SHIFT+ENTER, will return the products in order. But you will need a formula for all possible products.

    =INDEX($A$1:$A$8,SMALL(IF($B$3:$B$7=1,ROW($B$3:$B$7),ROW($B$8)),ROW(A3:A7)-ROW($A$3)+1))

    See attached.

    You can use a custom number format to hide the zeros.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

+ 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