Calculating COGS

Beginning Inventory + Purchases - COGAFS COGAFS - Ending Inventory - COGS May be a silly question but ....Is this the same regardless of what inventory system you are using? (ie. FIFO, LIFO, etc.)