|
楼主 |
发表于 2013-9-12 11:24
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
当在三维上求和时,Subtotal是个神奇的东东:
对于整个区域的汇总:
- =SUM(SUBTOTAL(9,INDIRECT(ROW(INDIRECT(TRIM(LEFTB($M$3,2))&":"&TRIM(LEFTB($M$4,2))))&"月份!"&"B2:F16")))
复制代码
同时扩展,通过Subtotal可以求得平均值、数字个数、非空单元格数、最大值、最小值:
- =AVERAGE(SUBTOTAL(1,INDIRECT(ROW(INDIRECT(TRIM(LEFTB($M$3,2))&":"&TRIM(LEFTB($M$4,2))))&"月份!"&"B2:F16")))
- =SUM(SUBTOTAL(2,INDIRECT(ROW(INDIRECT(TRIM(LEFTB($M$3,2))&":"&TRIM(LEFTB($M$4,2))))&"月份!"&"B2:F16")))
- =SUM(SUBTOTAL(3,INDIRECT(ROW(INDIRECT(TRIM(LEFTB($M$3,2))&":"&TRIM(LEFTB($M$4,2))))&"月份!"&"B2:F16")))
- =MAX(SUBTOTAL(4,INDIRECT(ROW(INDIRECT(TRIM(LEFTB($M$3,2))&":"&TRIM(LEFTB($M$4,2))))&"月份!"&"B2:F16")))
- =MIN(SUBTOTAL(5,INDIRECT(ROW(INDIRECT(TRIM(LEFTB($M$3,2))&":"&TRIM(LEFTB($M$4,2))))&"月份!"&"B2:F16")))
复制代码
跨工作表根据月份智能求和(增加Subtotal汇总及透视表法).zip
(42.98 KB, 下载次数: 1128)
|
|