Sigma for product of terms involving exponential

rg8588

New Member
Joined
Apr 26, 2018
Messages
4
Hi,

Please be kind. First time user.

I've got a formula as below. It describes the simple pharmokinetics of dosage and response. On day 1, there are no terms to sum. On day 2, there is one summation term. On day 3, there are two summation terms and so on. More weightage is provided to w(i) closer to day of calculation and lesser to those earlier through the exponential term.

ptSyW.jpg



i (lower limit) always starts at 1
The values of days n (upper limit) are stored in rows of column C beginning at C2.
The values of w for each day are stored in rows of column D beginning at D2
The value of the function f(n) are to be computed in Column E beginning at E2


This is the way I interpret the manual computation by hand. I offer an example:

Let's say for simplicity that constants k1 and tau1 are set to 1
Let's say we set first 4 rows of n as 1,2,3,4.

Let's say we set first 4 rows of w as 10.20,30,40

When n = 1, computation does not exist (?)
When n = 2, f(2) = 10 x e^(-1) = 3.678
When n = 3, f(3) = 10 x e^(-2) + 20 x e^(-1) = 8.711
When n = 4, f(4) = 10 x e^(-3) + 20 x e^(-2) + 30 x e^(-1) = 14.240


I've tried to compute f(n) in Excel with the following formula :
$B$4*SUMPRODUCT(D2*EXP(-(ROW(<wbr style="font-family: Arial, Helvetica, sans-serif;">INDIRECT("1:"&MAX(1,C2-1)))-1)<wbr style="font-family: Arial, Helvetica, sans-serif;">/$B$3))


This gives me

f(1) = 10
f(2) = 27.35758882
f(2) = 45.09644173
f(4) = 62.12007171

The result does not match up with the manually results (or my interpretation of the math).

Could someone please help shed some light on how I could correct this? Been really breaking my head over this. Thank you.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Maybe...


[Table="class: grid"][tr][td="bgcolor: #DCE6F1"][/td][td="bgcolor: #DCE6F1"]
C
[/td][td="bgcolor: #DCE6F1"]
D
[/td][td="bgcolor: #DCE6F1"]
E
[/td][td="bgcolor: #DCE6F1"]
F
[/td][td="bgcolor: #DCE6F1"]
G
[/td][td="bgcolor: #DCE6F1"]
H
[/td][/tr]
[tr][td="bgcolor: #DCE6F1"]
1
[/td][td]
n​
[/td][td]
w​
[/td][td]
k​
[/td][td]
tau1​
[/td][td][/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
2
[/td][td]
1​
[/td][td]
10​
[/td][td]
1​
[/td][td]
1​
[/td][td][/td][td]
Result​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
3
[/td][td]
2​
[/td][td]
20​
[/td][td][/td][td][/td][td][/td][td]
3,678794​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
4
[/td][td]
3​
[/td][td]
30​
[/td][td][/td][td][/td][td][/td][td]
8,710942​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
5
[/td][td]
4​
[/td][td]
40​
[/td][td][/td][td][/td][td][/td][td]
14,24096​
[/td][/tr]
[/table]


Formula in H3 copied down
=E$2*SUMPRODUCT(D$2:D2,EXP(-C2+C$2:C2-1))/F$2

Hope this helps

M.
 
Upvote 0
Maybe...


[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #DCE6F1"][/TD]
[TD="bgcolor: #DCE6F1"]
C
[/TD]
[TD="bgcolor: #DCE6F1"]
D
[/TD]
[TD="bgcolor: #DCE6F1"]
E
[/TD]
[TD="bgcolor: #DCE6F1"]
F
[/TD]
[TD="bgcolor: #DCE6F1"]
G
[/TD]
[TD="bgcolor: #DCE6F1"]
H
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
n​
[/TD]
[TD]
w​
[/TD]
[TD]
k​
[/TD]
[TD]
tau1​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
1​
[/TD]
[TD]
10​
[/TD]
[TD]
1​
[/TD]
[TD]
1​
[/TD]
[TD][/TD]
[TD]
Result​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
2​
[/TD]
[TD]
20​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
3,678794​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
3​
[/TD]
[TD]
30​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
8,710942​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD]
4​
[/TD]
[TD]
40​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
14,24096​
[/TD]
[/TR]
</tbody>[/TABLE]


Formula in H3 copied down
=E$2*SUMPRODUCT(D$2:D2,EXP(-C2+C$2:C2-1))/F$2

Hope this helps

M.


Hi Marcel

Thanks for coming to the rescue! I plugged it in, the numbers match the manually calculated values. I see where I made a mistake.

Just had a question on the term EXP(-C2+C$2:C2-1) . Just so I'm understanding this correctly, why there is no C3 called out, which is the current value of n? I only see C2 reference.
 
Upvote 0
Hi Marcel

Thanks for coming to the rescue! I plugged it in, the numbers match the manually calculated values. I see where I made a mistake.

Just had a question on the term EXP(-C2+C$2:C2-1) . Just so I'm understanding this correctly, why there is no C3 called out, which is the current value of n? I only see C2 reference.

The formula is copied down so take a look in the formula in H4
=E$2*SUMPRODUCT(D$2:D3,EXP(-C3+C$2:C3-1))/F$2

in H5
=E$2*SUMPRODUCT(D$2:D4,EXP(-C4+C$2:C4-1))/F$2

and so on

M.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top