Saturday, 4 October 2025

FIFO Methods of Valuing Cost Of Inventory

Angel Ltd deals in one item of inventory, Graphene with below details around Jan 2025. 

Inventory at 1 Jan, 40 units@$50 

Purchase at 6 Jan, 50 units@$52 

Sold on 11 Jan, 38 units 

Purchase on 16 January, 45units@$48 

Sold on 21 January, 58 units 

Sold on 26 January, 38 Units. 

Can you calculate the closing inventory at 31 January 2025 using the method FIFO?


Answer:

Closing Inventory at 31 January 2025 using FIFO = 1 unit @ $48 = $48


Graph by ChatGPT


Code by ChatGPT

import matplotlib.pyplot as plt

import matplotlib.ticker as mtick


# Dates of interest

dates = ["1 Jan", "11 Jan", "16 Jan", "21 Jan", "26 Jan", "31 Jan"]


# Total inventory value after each transaction

inventory_values = [2000, 2700, 4860, 1872, 48, 48]  # Value in dollars


# Total inventory units after each transaction

inventory_units = [40, 52, 97, 39, 1, 1]


# Per-unit cost (total value / total units)

unit_costs = [v/u for v, u in zip(inventory_values, inventory_units)]


# Plotting

fig, ax1 = plt.subplots(figsize=(10, 6))


# Bar chart for total inventory value

bars = ax1.bar(dates, inventory_values, color='skyblue', label='Total Inventory Value ($)')

ax1.set_ylabel('Total Inventory Value ($)', color='blue')

ax1.set_xlabel('Date')

ax1.tick_params(axis='y', labelcolor='blue')

ax1.set_title('Inventory Value and Per-Unit Cost Over Time (FIFO Method)')


# Annotate bars with unit cost

for bar, unit_cost in zip(bars, unit_costs):

    height = bar.get_height()

    ax1.text(bar.get_x() + bar.get_width()/2, height + 50, f"${unit_cost:.2f}", 

             ha='center', va='bottom', fontsize=10, color='black')


# Line chart on secondary y-axis for per-unit cost

ax2 = ax1.twinx()

ax2.plot(dates, unit_costs, color='orange', marker='o', label='Unit Cost ($)')

ax2.set_ylabel('Unit Cost ($)', color='orange')

ax2.tick_params(axis='y', labelcolor='orange')

ax2.yaxis.set_major_formatter(mtick.FormatStrFormatter('%.2f'))


# Add legends

fig.legend(loc='upper right', bbox_to_anchor=(1,1), bbox_transform=ax1.transAxes)


plt.tight_layout()

plt.show()



No comments:

Post a Comment

Machine Learning: Nearest Neighbor (NN) algorithm for stock transfers between warehouses

  🏭 Scenario: Nearest Neighbor Algorithm for Warehouse Stock Transfer Background A company, GrapheneTech , distributes graphene sheets a...