Counting and summing amounts in column
发布时间:2026-10-16 | 浏览:1
I have a spreadsheet with two tabs. "Orders" tab and "Stats" tab. In "Orders" tab has 1 column with several thousand rows (2867) containing positive and negative amounts, amounts are random and unsorted.
"Stats" tab has 6 cells in which I wish to count a VARIABLE number of positive amounts and the sum of the positive amounts from the "Orders" tab, also count and sum the same number of VARIABLE negative amounts. The count of Pos. & Neg. values may be less than the variable if there are fewer Pos. or Neg. values that the variable is looking for.
Attached is a link to my Workbook. Sheet "Orders" contains data that is used by sheet "Stats". Orders sheet column A is used by the Stats sheet to calculate most (rows 2-28) of the statistics on the sheet, but I really do not want to have this column and to have to update it each time I insert new rows.
Calculations in cells in rows 1-28 need to be able to make calculations from Orders sheet using the whole number in the "Purple" cell associated with their set of calculations (i.e. Columns A-D, Rows 2-10, etc.). These are for the last number (Purple) of trades, regardless of Win or Lose.
The calculations in Columns A-D, Rows 34-42 are similar but the number (Purple) is for the last number of Winning Trades (for example: last 10 Wins) and for the same number of Losing trades (same example: Last 10 Losses).
As stated above, when I add new trades (rows) to this workbook, I want to not make any adjustments or changes to the Orders sheet other than adding the new rows. I have been trying to use one of the COUNT and SUM functions to accomplish this and have been stumped.
Hope someone can HELP! 😁😁
https://1drv.ms/u/s!BDvJQgN99DBvzG2-n67J3LDs9sb4?e=Eiekc0
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Ashish Mathur • 102.6K Reputation points • Volunteer Moderator 2022-01-09T23:57:58+00:00 Hi, Just as for counting negative numbers, you are going all the way till cell A27 (just so that you get 10 negative numbers), the same logic should apply to positive numbers as well. The first 10 positive numbers are in range A3:A10 and then from A12:A13. This adds up to 73.47. Am i not correct? 0 comments No comments
Just as for counting negative numbers, you are going all the way till cell A27 (just so that you get 10 negative numbers), the same logic should apply to positive numbers as well. The first 10 positive numbers are in range A3:A10 and then from A12:A13. This adds up to 73.47. Am i not correct?
Anonymous 2022-01-09T23:45:06+00:00 =SUMIF(A3:A12,">0") for positive values = $73.24 You caught me if a big error on the negative number. I was just visually counting the negatives and mistakenly included the positives. Resulting in my error. Should have used the following: =SUMIF(A3:A27,"<=0") = -$14.19 Hope this clears things up. Again, Thank you for pointing my error out. Bill F. 0 comments No comments
=SUMIF(A3:A12,">0") for positive values = $73.24
You caught me if a big error on the negative number. I was just visually counting the negatives and mistakenly included the positives. Resulting in my error. Should have used the following:
=SUMIF(A3:A27,"<=0") = -$14.19
Hope this clears things up. Again, Thank you for pointing my error out.
Anonymous 2022-01-09T23:31:17+00:00 Thanks for the reply Hans V. But I apparently was not clear on my request/need. What I am wanting is to be able to change the variable in A1 (shown as 10 on the Stats sheet cell A1) to any positive integer and report on that number of positive/negative values. With a value of 10, the positive count is 10 and the amount is $73.24. The negative count is 10 and the value is -$66.84. Positives are A3:A12 and negatives are A3:A27. I am working with a Currency Trading account and wish to know what my Profit/Loss was for the last 10, 50, 100, etc. number of trades. I do appreciate your response, Thank you Bill F. 0 comments No comments
Thanks for the reply Hans V. But I apparently was not clear on my request/need.
What I am wanting is to be able to change the variable in A1 (shown as 10 on the Stats sheet cell A1) to any positive integer and report on that number of positive/negative values. With a value of 10, the positive count is 10 and the amount is $73.24. The negative count is 10 and the value is -$66.84. Positives are A3:A12 and negatives are A3:A27.
I am working with a Currency Trading account and wish to know what my Profit/Loss was for the last 10, 50, 100, etc. number of trades.
I do appreciate your response,
Ashish Mathur • 102.6K Reputation points • Volunteer Moderator 2022-01-09T23:29:09+00:00 Hi, How did you arrive at 66.84? Also, if you are adding negative numbers, then how can the result be a positive number (66.84)?. Even in calculating 73.24, you are adding only the first 9 positive numbers (ignoring -12.8). Why? 0 comments No comments
How did you arrive at 66.84? Also, if you are adding negative numbers, then how can the result be a positive number (66.84)?. Even in calculating 73.24, you are adding only the first 9 positive numbers (ignoring -12.8). Why?
HansV • 462.7K Reputation points • MVP • Volunteer Moderator 2022-01-09T22:49:17+00:00 Let's say the values are in A3:A3000 on the Orders sheet. Number of positive amounts: =COUNTIF(Orders!A3:A3000,">0") Sum of positive amounts: =SUMIF(Orders!A3:A3000,">0") Number of negative amounts: =COUNTIF(Orders!A3:A3000,"<0") Sum of negative amounts: =SUMIF(Orders!A3:A3000,"<0") 0 comments No comments
Let's say the values are in A3:A3000 on the Orders sheet.
Number of positive amounts: =COUNTIF(Orders!A3:A3000,">0")
Sum of positive amounts: =SUMIF(Orders!A3:A3000,">0")
Number of negative amounts: =COUNTIF(Orders!A3:A3000,"<0")
Sum of negative amounts: =SUMIF(Orders!A3:A3000,"<0")