Excel難題請教

2010-09-14 11:12 pm
想因應下列資料,求出結果。 謝謝!!

Name$
Man251665
Eric98440
Peter19900
Mo13770
Man251665
Eric98440
Peter19900
Mo13770
John125625
Cathy83825
Peter99785
Ann81330
Pearl43155
Cathy83825
John125625
Cathy83825
Peter99785
Ann81330
Pearl43155


求結果排名求結果Name求結果$
1Man503330
2Cathy251475
3John251250
4Peter239370
5Eric196880
6Ann162660
7Pearl 86310
8Mo 27540

Report.xls dl → http://www.webo.com.hk/download.php?i=400259
更新1:

不懂用macro... 可以用公式嗎?

更新2:

[email protected] Many Thx!

回答 (2)

2010-09-16 7:29 am
✔ 最佳答案
先求Name (Column N), 後求$(Column O)
N5=INDEX(C:C,RIGHT(MAX(IF(COUNTIF(N$1:N4,C$6:C$37)=0,SUMIF(C$6:C$37,A$6:C$37,I$6:I$37)*100+ROW($6:$37))),2))
陣列公式, Ctrl + Shift + Enter 三鍵輸入, 然後下拉
O5=SUMIF(C$6:C$37,N5,I$6:I$37)
下拉

http://webo.com.hk/download.php?i=401024
2010-09-15 2:30 am
下列 macro, 可以完成任務:
Dim n(50), s(50)

Sub Macro1()
'
For i = 1 To 50: n(i) = "": s(i) = 0: Next ida = 1: n(1) = "Eric"
t = 0For i = 5 To 50x1 = Trim(Cells(i, 3))
x2 = Cells(i, 9)If Len(x1) < 2 Then GoTo rep1f = 0
For j = 1 To da
If n(j) = x1 Then
f = 1
s(j) = s(j) + x2
End If
Next jIf f = 0 Then
da = da + 1
n(da) = x1
s(da) = x2
End Ift = t + x2rep1:
Next iFor k = 1 To da
Cells(4 + k, 13) = k
Cells(4 + k, 14) = n(k)
Cells(4 + k, 15) = s(k)
Next kRange(Cells(5, 14), Cells(da + 4, 15)).Select
Selection.Sort Key1:=Range("o5"), Order1:=xlDescending, Orientation:=xlTopToBottom


Cells(da + 7, 15) = tEnd Sub

2010-09-15 12:58:09 補充:
請告知你的 e-mail address, 我會將寫上 macro 的 file 寄給你.


收錄日期: 2021-05-03 00:49:54
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20100914000051KK00605

檢視 Wayback Machine 備份