PDA

View Full Version : Problems with Sum Function



Cinema
09-23-2016, 03:02 AM
Hi,


is there any way to write such a formula? :




For j = 1 To 3000
For i = 1 To 8

Sheets("Table1").Cells(j, 10).Formula = SUM_over j (Cells(j, 2) + SUM_over i(Cells(j, i) * (Cells(4, i - 1).Value - 0.5))

Next i
Next j

Leith Ross
09-23-2016, 07:43 AM
Hello Cinema,

What is the code for the SUM_over ?

Cinema
09-23-2016, 10:04 AM
thats the problem I have. How can you define such a sum?

SamT
09-23-2016, 06:35 PM
@ Cinema,

You are the only person in the world who knows what SUM_over needs to do.

offthelip
09-24-2016, 04:59 PM
Do you mean something like this:
in J8
=SUM(B$5:B8)+A$4*B8+B$4*C8+C$4*D8+D$4*E8+E$4*F8+F$4*G8+G$4*H8+H$4*I8-0.5
Note: I assumed i starts at 2 not 1 Because:
your equation will fall over as it is written when i=1 ( the start of the loop) Cells(4,i-1) will give a column index of zero,

mikerickson
09-25-2016, 09:19 AM
Perhaps something like

=SUMPRODUCT(B2:I3001,A1:H3000-.5)