Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two rows of data

Row B = price of product
Row C = quantity of producst

I need to get the summary price:


I don't know n (quantity of columns) because n is changing from time to time (from 50-1000). And I don't want to specify all n in formula.

Is it possible to write a summation formula for any n?

share|improve this question

migrated from superuser.com Aug 13 '11 at 13:46

This question came from our site for computer enthusiasts and power users.

Use an array formula. ;) – Breakthrough Jul 5 '11 at 13:22

Use sumproduct().

You could either change the formula every time (only involves changing two cells) or just go with:


Alternatively you could write yourself a short function that:

  1. Checks the two input ranges are the same size
  2. Calculates the size of the ranges (say 'X')
  3. Runs a loop 'X' times multiplying the two range values together and maintaining a total

However I would just use sumproduct().

share|improve this answer

If you do not want to make the formula depending on the number of rows, you can simply use the formula =SUMPRODUCT(B:B;C:C). If you have a more elaborated need, please let me know.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.