View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default How to write a function for column A = product of two columns, B a

You need to decide what you want.

If, as you say, you want *all* the cells in column A to be populated by the
result of the product of *all* the cells in two other columns, B and C,
then in A1 you can put the formula
=PRODUCT(B$1:B$10, C$1:C$10)
and then fill the formula down (using the fill handle in the bottom
right-hand corner of the cell) through A2:A10 to get the same result in all
10 cells in A.

If, instead, you want *each of* the cells in column A to be populated by the
result of the product of *the corresponding* cells in two other columns, B
and C, then in A1 you can put the formula
=PRODUCT (B1, C1) or just =B1*C1,
and then fill the formula down through A2:A10 to get the appropriate
results in A2:A10.

If, rather than either of those, you want one result in column A to be the
*sum* of the B*C products, the formula is
=SUMPRODUCT(B1:B10,C1:C10)
--
David Biddulph

"wlfoote" wrote in message
...
How do I select all the cells in column A to be populated by the result of
the product of all the cells in two other columns, B and C.

In other words:

I would like A1:A10 = PRODUCT (B1:B10, C1:C10). However, the resultant ten
values ends up cell A1, not cells A1:A10.