close

Hi everyone...

I need to figure out how to create a new variable that is a cumulative
sum of an existing variable with conditions. an example is below where
sumnumber is what i am trying to create. any help would be appreciated.
thanks.
subject visit number sumnumber
1000 1 5 5
1000 3 6 11
1000 4 2 13
1000 7 4 17
2000 1 0 0
2000 2 2 2
2000 3 0 2
3000 4 5 5
4000 1 2 2
4000 4 2 4--
chiapas77
------------------------------------------------------------------------
chiapas77's Profile: www.excelforum.com/member.php...oamp;userid=30568
View this thread: www.excelforum.com/showthread...hreadid=502153
Try

=IF(A1=A2,D1 C2,C2) copied down

Where A1=Subject title, A2=first entry
C1=Number title, C2=first entry

And D2 is where you star entering your data.--
Vito
------------------------------------------------------------------------
Vito's Profile: www.excelforum.com/member.php...oamp;userid=29182
View this thread: www.excelforum.com/showthread...hreadid=502153Assuming that subject is sorted as your example shows:

D2: =C2
D3: =IF(A3=A2,D2 C3,C3)

copy D2 down as far as necessary.

In article gt;,
chiapas77 gt;
wrote:

gt; Hi everyone...
gt;
gt; I need to figure out how to create a new variable that is a cumulative
gt; sum of an existing variable with conditions. an example is below where
gt; sumnumber is what i am trying to create. any help would be appreciated.
gt; thanks.
gt;
gt;
gt;
gt; subject visit number sumnumber
gt; 1000 1 5 5
gt; 1000 3 6 11
gt; 1000 4 2 13
gt; 1000 7 4 17
gt; 2000 1 0 0
gt; 2000 2 2 2
gt; 2000 3 0 2
gt; 3000 4 5 5
gt; 4000 1 2 2
gt; 4000 4 2 4


seemed to work pretty good. thanks.--
chiapas77
------------------------------------------------------------------------
chiapas77's Profile: www.excelforum.com/member.php...oamp;userid=30568
View this thread: www.excelforum.com/showthread...hreadid=502153

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()