简体   繁体   中英

How to calculate relative average cost by department in excel?

So I am trying to calculate the average cost of On-Hand goods in this example. The goal of this would be to determine the overall cost of goods by department. This would be achieved arithmetically by taking the average cost of the good and multiplying it by the number of goods on hand for that item, and then repeating for each item. I would then want to add items from the same numerical departments to get a department item cost. Is there a way to do this within a single function in excel? So far I have:

=IF($B$2:$B$17=F2,SUMPRODUCT($C$2:$C$17,$D$2:$D$17),"null")

but it is returning an invalid output.

For Cell J2, the output I would want to look for is: $74093.80

The reason I want to do this by function is because I have a spreadsheet with over 76,000 items and 19 different departments on it and need to calculate the Average Inventory Cost of each Department.

Thank you in advance!

Click here for Excel sheet

将测试放入SUMPRODUCT()中:

=SUMPRODUCT(--(B$2:$B$17=F2),$C$2:$C$17,$D$2:$D$17)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM