Copy formula help

L

Lance

I have the following formula I need to repeat
=((A2*A5)+(B2*B5)+(C2*C5)+(D2*D5)+(E2*E5)+(F2*F5)+(G2*G5)+(H2*H5)+
(I2*I5)+(J2*J5))

Row 2 has fixed values
Row 5 down has entered values

I need to copy this formula down, but have the row 2 references stay
put, with only the cells in row 5 changing.
When drag the formula down everything increments by 1

When I get to row 20 the formula should look like:
=((A2*A20)+(B2*B20)+(C2*C20)+(D2*D20)+(E2*E20)+(F2*F20)+(G2*G20)+
(H2*H20)+(I2*I20)+(J2*J20))

Instead I end up with stuff like this, if I try and copy the formula
from row 20 to 21
=((A3*A21)+(B3*B21)+(C3*C21)+(D3*D21)+(E3*E21)+(F3*F21)+(G3*G21)+
(H3*H21)+(I3*I21)+(J3*J21))

Notice how row 3 is now being used in the calculation instead of row
2.

I just can not figure out how to lock row 2 so that it does not change
when I try and use the fill handle.

Thanks,
Lance
 
B

Bob Umlas

=((A$2*A5)+(B$2*B5)+(C$2*C5)+(D$2*D5)+(E$2*E5)+(F$2*F5)+(G$2*G5)+(H$2*H5)+
(I$2*I5)+(J$2*J5))
will work.
But a better formula is
=SUMPRODUCT($A$2:$H$2,A5:H5)
which also fills down nicely!
Bob Umlas
Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top