# Help with Cost Calculation

#### mavrik_stet

##### New Member
Hi,

Basically I'm trying to calculate the cost of good sold every month (for 20 years) using first in first out.
Row 9 in my photo indicates the number of new inventory that goes in every month, row 10 is the cost to be applied for the inventories that flowed in (added) for that month.

Row 12 is essentially a schedule on how the inventories are going to be wind down/sold (see total for rows 9 and 12 are equal just diff signs). Now, I need to calculate cost of goods and that involves using the appropriate cost. (ie. first 3,603 should be multiplied by 53.49, after that next 533.64 should be multiplied by 23.09 and so forth). However, I don't know the correct formula that would give me the correct cost to be applied automatically rather than manually.

Does anyone know how I can do this automatically?

Thank you!

#### Attachments

• sample photo.png
20 KB · Views: 7

### Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},\$Z\$1:\$Z\$99,\$Y\$1:\$Y\$99),2,False) to lookup Y values to left of Z values.

Replies
1
Views
79
Replies
6
Views
197
Replies
4
Views
185
Replies
0
Views
306
Replies
3
Views
181

1,127,832
Messages
5,627,152
Members
416,224
Latest member
RichardHell

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back