For the first question, use the following user defined function where MyRange is the range of counts and prices.
Function SumProductsSpecial(MyRange As Range)
If MyRange.Rows.Count > 1 Then Exit Function
LeftColumn = MyRange.Column
RightColumn = LeftColumn + MyRange.Count - 1
ColumnCount = RightColumn - LeftColumn + 1
If ColumnCount / 2 <> Int(ColumnCount / 2) Then Exit Function
For N = LeftColumn To RightColumn Step 2
SumProductsSpecial = SumProductsSpecial + Cells(MyRange.Row, N) * Cells(MyRange.Row, N + 1)
Next N
End Function
The second can be answered by a similar function
Function SumAlternates(MyRange As Range)
If MyRange.Rows.Count > 1 Then Exit Function
LeftColumn = MyRange.Column
RightColumn = LeftColumn + MyRange.Count - 1
ColumnCount = RightColumn - LeftColumn + 1
For N = LeftColumn To RightColumn Step 2
SumAlternates = SumAlternates + Cells(MyRange.Row, N)
Next N
End Function
Bookmarks