ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sum within a column, according to another column (https://www.excelbanter.com/excel-worksheet-functions/221863-sum-within-column-according-another-column.html)

Auditor

Sum within a column, according to another column
 
I have two columns. One column contains the prices of each item sold. The
other column is called a line number and begins with one for new
transactions. So if a customer bought 4 items, it will go up to 4. Is there
any way to sum just those in a transaction, and then do it for hundreds of
other transactions?

Mike H

Sum within a column, according to another column
 
Hi,

This isn't clear, post some sample data and the desired result.

Mike

"Auditor" wrote:

I have two columns. One column contains the prices of each item sold. The
other column is called a line number and begins with one for new
transactions. So if a customer bought 4 items, it will go up to 4. Is there
any way to sum just those in a transaction, and then do it for hundreds of
other transactions?


Shane Devenshire[_2_]

Sum within a column, according to another column
 
I second Mike comment.

If your data looks like this in the transaction column:

1
2
1
2
3
4

Then if you want to sum the first 1 and 2 then the second 1, 2, 3, 4 and so
on. It would be much better if you had a customer column so you could easily
destinguish which items below to which customer. If not then here is a
formula to put in column C and copy down. I'm assuming the first row is
titles so your first data is in A2:B2 and this formula goes into C2:

=IF(A2<A3,"",SUM(OFFSET(B2,0,0,-A2)))

Copy this formula down as far as needed.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Auditor" wrote:

I have two columns. One column contains the prices of each item sold. The
other column is called a line number and begins with one for new
transactions. So if a customer bought 4 items, it will go up to 4. Is there
any way to sum just those in a transaction, and then do it for hundreds of
other transactions?



All times are GMT +1. The time now is 02:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com