# Custom function needed

#### Viktor1

##### New Member
Could somebody help me create a custom function that returns the following: A*SUM(A1:AN)+B*SUM(B1:BN)+C*SUM(C1:CN)+....+M*SUM(M1:MN) The variables would be A, A1, and MN. Many thanks!

A A1 A2 A3 ......AN
B B1 B2 B3 ......BN
C C1 C2 C3 ......CN
. . . . .
. . . . .
. . . . .
M M1 M2 M3 ......MN

#### Kamolga

##### Well-known Member
What is A? B? C? is it row number?

#### ZVI

##### MrExcel MVP
There is Excel function SUMPRODUCT for a such calculation.
Let's assume that M=4 and N=5 then do as follows:
1. Put coefficients A,B,C,D into the cells A1:A4
2. Put numbers into the cells B1:F4
3. Apply this formula to the cell L1: =SUMPRODUCT(A1:A4*B1:F4)

Last edited:

#### Viktor1

##### New Member
Thanks again! You saved me a lot of time.

1,081,702
Messages
5,360,743
Members
400,595
Latest member
T_Dubs

### This Week's Hot Topics

• VBA (Userform)
Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
• List box that changes fill color
Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
• Remove duplicates and retain one. Cross-linked cases
Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
• VBA Copy and Paste With Duplicates
Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
• Macro
is it possible for a macro to run if the active cell value is different to the value above it
• IF DATE and TIME
I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...