FIFO script for Google Sheets

One of my first outputs here on MineNiches isn’t about websites and content. Today I want to show you my script for calculating FIFO stocks in Google Sheets. This script might help you in cases you are a small investor in stocks and your country deals with “tax exemption” for FIFO methods.

For example, in the Czech Republic where I live, we cannot include profits from selling stocks/ETF in tax if I own asset more than 3 years. So when I do taxes, I can keep track on how long I’ve owned the asset and if it’s more than 3 years, then I can sell it without taxation.

I sold some assets in 2022, so I have to keep an eye on whether I have to pay tax on it or not. Because I have a lot of asset purchases that I’m selling, I have to calculate a lot. For that reason, I’ve created a script to help me calculate FIFO with stocks, and today I want to share it with you.

How does it work?

I’ve created a Google Sheet contains two “lists”, one of which must contain your “purchases” and the other must contain your “sales”. To fill this sheet, you need to use data from your trading app. You need to centralize all of your purchases…


…so you have all your purchases and expenses on one sheet. On the second sheet you need to fill in all your sales also in format you know from upper list. After filling in all the data, you still don’t have detailed information you need for the future calculations…

Output list with sales without calculated information

…it is because you will need to open “App Script” tab and run a script that will calculate all of the detailed information you need. The script and detailed information on how to use it are inside my package, which you can buy on Gumroad for 20$.

Output is the calculated cost of the assets and “youngest stock” used in this sale

How to get FIFO Script for Google Sheets?

You can find Google Sheet for FIFO calculation on my Gumroad.

The price for these scripts starts at 20$ and it is recommended to count several assets manually.

I'm main creator of MineNiches where you should find more informations about mine small websites, small tech tools and tips for better SEO.