+ Reply to Thread
Results 1 to 3 of 3

Indicator variables and calculating differences between numbers in a list

  1. #1
    Registered User
    Join Date
    01-17-2007
    Posts
    9

    Indicator variables and calculating differences between numbers in a list

    I decided to rewrite my question and change the title, to be more descriptive

    Here is the problem:
    I got three columns. The left one is the day number. The middle column is for indicator variables 1 or 0. This is suppose to be chosen by the solver function.

    I want the third column to show the DIFFERENCE between the "chosen" days.
    This can be better explained through an example:

    07 | 0 |
    10 | 1 | 10
    14 | 0 |
    17 | 1 | 7
    14 | 0 |
    17 | 0 |
    21 | 1 | 4

    How do I do this?

    (extra information: the indicator values are chosen by solver based on several criteria not stated here, but this particular part of the sheet is suppose to refrain the chosen days to have differences between them larger or smaller than a given value.

    Thank you so much in advance!
    Last edited by HaZeR86; 06-10-2009 at 08:16 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    11-11-2008
    Location
    Euro
    MS-Off Ver
    2007, 2010
    Posts
    470

    Re: Indicator variables and calculating differences between numbers in a list

    I assume your data to locate at A1:B7 , and the result at C1:C7
    Plz do fllow steps

    + at cell C1, enter the formula
    PHP Code: 
    =IF(B1=1,B1,""
    + at cell C2, enter the formula
    PHP Code: 
    =IF(B2=1,A2-SUM(C1:C$1),""
    + at C3:C7 - Copy formula from C2

    I hope that help you succesfully
    Last edited by shg; 06-08-2009 at 06:12 PM.

  3. #3
    Registered User
    Join Date
    01-17-2007
    Posts
    9

    Re: Indicator variables and calculating differences between numbers in a list

    This worked beautifully! Thank you so much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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