| View previous topic :: View next topic |
| Author |
Message |
danradice General User

Joined: 11 Apr 2007 Posts: 6
|
Posted: Mon Jun 11, 2007 6:42 am Post subject: Conditional Summing |
|
|
Another rookie question here,
I need to sum all the money totals in a row that also have 'Y' in the cell below to say that they've been paid. What's the formula for this?
Thanks to all those experienced Calc users that make this forum work so well, I hope to start giving back once I know what I'm doing.
Dan  |
|
| Back to top |
|
 |
squenson Super User


Joined: 09 Mar 2007 Posts: 690 Location: Nis, Serbia
|
Posted: Mon Jun 11, 2007 9:12 am Post subject: |
|
|
danradice,
Assuming that the range of amounts is in cells D2:O2, and the "Y" are just below, the formula is: | Code: | | =SUMPRODUCT(D2:O2="Y";D1:O1) |
SUMPRODUCT is a powerful function that multiplies all the arguments of arrays of same length, then makes the sum of the result of all these multiplications. The trick in the forula above is to use a condition that has a value of 1 if TRUE, or 0 if FALSE. Therefore, it will multiplies all these 0's or 1's with the corresponding amount, and make the sum you need. _________________ Help us to help you: Add [Solved] to the title of the thread if you agree with the answer
>>> Do you know the new OOo support forum http://user.services.openoffice.org/en/forum/index.php? <<< |
|
| Back to top |
|
 |
David Super User


Joined: 24 Oct 2003 Posts: 5668 Location: Canada
|
Posted: Mon Jun 11, 2007 9:24 am Post subject: |
|
|
"I hope to start giving back once I know what I'm doing. "
A word of advice: Start sooner. I have been doing it for a while and still don't know what I'm doing.
David. |
|
| Back to top |
|
 |
|