调试经验——Excel函数矩阵相乘函数(MMULT)的应用 (Use of MMULT function in Excel)

需求描述:

已知三种产品A、B、C的单位成本(原材料、人工费、杂费)如下表所示。

ExpensesProduct AProduct BProduct C
Raw Materials0.10.30.15
Labor0.30.40.25
Overhead and miscellaneous0.10.20.15

各产品各季度的产量如下表所示,

ProductSummerFallWinterSpring
A4000450045004000
B2000260024002200
C5800620060006000

 试汇总计算各季度各成本项的总成本。

 

解决方法:

使用MMULT函数。

Matrix Multiplication (MMULT)    
Total ExpensesSummerFallWinterSpringYear Total
Raw Materials18702160207019608060
Labor345039403810358014780
Overhead and miscellaneous16701900183017407140
Total Production Costs699080007710728029980

显示公式后是这样的(局部):

Matrix Multiplication (MMULT)  
Total ExpensesSummerFall
Raw Materials=MMULT(Table3[[Product A]:[Product C]],Table2[[Summer]:[Spring]])=MMULT(Table3[[Product A]:[Product C]],Table2[[Summer]:[Spring]])
Labor=MMULT(Table3[[Product A]:[Product C]],Table2[[Summer]:[Spring]])=MMULT(Table3[[Product A]:[Product C]],Table2[[Summer]:[Spring]])
Overhead and miscellaneous=MMULT(Table3[[Product A]:[Product C]],Table2[[Summer]:[Spring]])=MMULT(Table3[[Product A]:[Product C]],Table2[[Summer]:[Spring]])

 可见,只需一个简单的MMULT(Array1, Array2)即可计算出一张汇总表,非常方便。


注意:也可以使用sumproduct函数进行计算,不过,需要将第一个表格进行转置(transpose)操作转换为以下形式。

ExpensesRaw MaterialsLaborOverhead and miscellaneous
Product A0.10.30.1
Product B0.30.40.2
Product C0.150.250.15

然后,需要针对不同的产品和成本项调整sumproduct公式中的参数。相比使用矩阵乘法,麻烦很多。 

MMULT函数的详细介绍和用法,可参考下文:

https://www.excelfunctions.net/excel-mmult-function.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值