Answer the question
In order to leave comments, you need to log in
How to calculate the sum of the negative elements of an array?
Form the elements of the array according to the rule хi=sin(2i)-cos3 (i). Display its elements in column A. Calculate the sum of negative array elements. Display negative elements in a separate column.
Please help me calculate the sum of the negative elements of the array. Display negative elements in a separate column.
Private Sub calc_Click()
Dim y As Double
Dim i, k, n As Integer
For i = 2 To 11
y(i) = ("Sin * (2 * x) - Cos ^ 3 * x")
Cells(i + 1, 1) = x(i)
Next i
Min = x(1)
For i = 2 To 11
If
End If
Next i
End Sub
Answer the question
In order to leave comments, you need to log in
Dim Counter as Double
Dim cellNum, Cycle as Integer
cellNum = 1
for Cycle = 0 to UBound(y)
if y(Cycle).Value < 0 then
Cells(2,cellNum).Value = y(Cycle).Value
cellNum = cellNum + 1
Counter = Counter + y(Cycle).value
End if
next Cycle
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question