Excel 篩選數列中的正負數值並加以計算 問題

2012-09-21 11:23 pm
請問如果有一長串數列,
例如:
100
41
10
-10
6
-34
-6
54
25
35
56
0
-25

條件:
1. 挑選數列中(大於0的數值加總 X 200 減挑選的個數 X 1000) / 挑選的個數
2. 挑選數列中(小於0的數值加總 X 200 減挑選的個數 X 1000) / 挑選的個數
3. 條件1算出的值/條件2算出的值取絕對值

以上有辦法寫成程式嗎?
謝謝Excel專家們的幫忙

回答 (3)

2012-09-25 7:25 pm
✔ 最佳答案
C1:
=(SUMIF(A1:A13,">0")*200-COUNTIF(A1:A13,">0")*1000)/COUNTIF(A1:A13,">0")

C2:
=(SUMIF(A1:A13,"<0")*200-COUNTIF(A1:A13,"<0")*1000)/COUNTIF(A1:A13,"<0")

C3:
=ABS(C1/C2)

2012-09-25 11:25:02 補充:
EXCEL.分別取出〔>0或<0〕的〔總計〕及〔個數〕運算
                       <.准提部林.>
-------------------------------
■條件1:
 (大於 0 的數值加總 X 200 減 挑選的個數 X 1000) / 挑選的個數
 C1公式:
 =(SUMIF(A1:A13,">0")*200-COUNTIF(A1:A13,">0")*1000)/COUNTIF(A1:A13,">0")
 或
 =SUMIF(A1:A13,">0")*200/COUNTIF(A1:A13,">0")-1000
 
■條件2:
 (小於 0 的數值加總 X 200 減 挑選的個數 X 1000) / 挑選的個數
 C2公式:
 =(SUMIF(A1:A13,"<0")*200-COUNTIF(A1:A13,"<0")*1000)/COUNTIF(A1:A13,"<0")
 或
 =SUMIF(A1:A13,"<0")*200/COUNTIF(A1:A13,"<0")-1000
 
■條件3:
 條件1算出的值/條件2算出的值取絕對值
 C3公式:
 =ABS(C1/C2)
 或
 =ABS((SUMIF(A1:A13,">0")*200/COUNTIF(A1:A13,">0")-1000)/
  (SUMIF(A1:A13,"<0")*200/COUNTIF(A1:A13,"<0")-1000))
--------------------------------
2012-09-22 7:52 am
2012-09-22 12:54 am
1.c1=(SUM(IF(A1:A13>0,A1:A13))*200-(SUM(IF(A1:A13>0,1,0)))*1000)/SUM(IF(A1:A13>0,1,0))陳列公式

2.c2=(SUM(IF(A1:A13<0,A1:A13))*200-(SUM(IF(A1:A13<0,1,0)))*1000)/SUM(IF(A1:A13<0,1,0))陳列公式

3.abs(c1/c2)


收錄日期: 2021-04-27 19:53:26
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20120921000016KK03566

檢視 Wayback Machine 備份