dividend – MAD Hat Lab https://madhatlab.com Sun, 27 Jun 2021 08:11:13 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.3 https://i0.wp.com/madhatlab.com/wp-content/uploads/2019/08/cropped-Mad-Hat.png?fit=32%2C32&ssl=1 dividend – MAD Hat Lab https://madhatlab.com 32 32 165168261 The BEST Stock Portfolio Tracker Spreadsheet Ever! – How I Keep Track of My Dividend Growth Portfolio Using Google Sheets (Part 3 – Stock Portfolio Overview) https://madhatlab.com/the-best-stock-portfolio-tracker-spreadsheet-ever-how-i-keep-track-of-my-dividend-growth-portfolio-using-google-sheets-part-3-stock-portfolio-overview/?utm_source=rss&utm_medium=rss&utm_campaign=the-best-stock-portfolio-tracker-spreadsheet-ever-how-i-keep-track-of-my-dividend-growth-portfolio-using-google-sheets-part-3-stock-portfolio-overview Tue, 08 Dec 2020 16:51:17 +0000 http://madhatlab.com/?p=595 Like I promised in part 2 of my portfolio tracker series, part 3 of my portfolio tracker post will show you how to create a portfolio overview. If you haven’t read part 2 of my post, I highly recommend you do so first because the formula in this sheet will be connected to the that of part 2: trade log.

A warning: This post is going to be lengthy and full of text. Feel free to stop at anytime to take a break and pick up where you left off. I will try to to break this into sections to make it easier.

This sheet lists all my holdings in detail and shows

  • Ticker. You have to input this cell manually
  • Name of the company.
  • Number of shares and the cost basis
  • Current price
  • Today’s Change in price (in $ and %)
  • Total Gain/ Loss (in $ and %)
  • Annual Dividend, Dividend Yield & Yield on Cost
  • Account that purchases the stock
  • Sectors and Assets Type
  • Allocation of the stocks in proportion to the whole portfolio
  • Real time currency conversion based on USD

The Layout

You should create your stock portfolio overview in a new sheet and it can look however you want it to look. Personally, I lay out my cells in the following way.

Your Stock Portfolio Overview can look something like this

In this page, I only need to input

  • Cash available in each account,
  • Ticker symbol the first time the stock is purchased
  • Account that first time purchases the said stock.
  • 1 of 6 Currency available (converted from USD)

Everything else will automatically be populated by the spreadsheet.

A note about the currency conversion. All currency is converted from USD, so based on the currency chosen, every information in this page will be in the selected currency.

This is particularly useful when you are investing in the U.S stock market but your capital is from a different currency, like me.

Key Info Section

I put my cash balance and, total gain/ loss, annual dividend and income on the top of the sheet because you don’t want to scroll all the way down just to find key information about your portfolio.

The Top Part of the Sheet

Now for the header of the portfolio section, I include horizontally:

  1. Name of the company
  2. # of shares
  3. Cost Basis
  4. Total Cost Basis
  5. Current Price
  6. Today’s Change (in $ and %)
  7. Gain/ Loss (in $ and %)
  8. Total Gain/ Loss for that stock
  9. Annual Dividend Income per share
  10. Dividend Yield
  11. Total Annual Income of the Dividend
  12. Assets Type
  13. Sector
  14. Account that purchases the stock
  15. % allocation to the portfolio for the stock

Since I am using screen shot, I am sorry for the quality of the picture but here goes:

(1) – (8) from the list above
(9) – (15) from the list above

The Formula

The Basic

A lot of the formula that I used is just designating the right cells for the formula to refer to in the equation, thus a basic understanding of how Google Sheets’ formula works will help in understanding the rest of this post.

=sumifs

A formula that tells the spreadsheet to sum specified cells IF a number of criteria is found.

‘Sheet name’!A1

The cell will go to sheet “Sheet name” and refer to that sheet’s cell A1

Name of the company

=googlefinance(B16,”name”).

B16 is the cell for the ticker that you want the spreadsheet to refer to when fetching the name. For example, if you put “AAPL” in B16, then this cell will refer to “AAPL” and produce “Apple Computers Inc.”

# of shares

=SUMIFS(‘Trade Log’!$E$1:’Trade Log’!$E$1000,’Trade Log’!$C$1:’Trade Log’!$C$1000,B16,’Trade Log’!$B$1:’Trade Log’!$B$1000,”Buy”,’Trade Log’!$D$1:’Trade Log’!$D$1000,W16)-(sumifs(‘Trade Log’!$E$1:’Trade Log’!$E$1000,’Trade Log’!$C$1:’Trade Log’!$C$1000,B16,’Trade Log’!$B$1:’Trade Log’!$B$1000,”Sell”,’Trade Log’!$D$1:’Trade Log’!$D$1000,W16))

‘Trade Log’!$E$1:‘Trade Log’!$E$1000 = Column E1 to E1000 of the Trade Log sheet where you input # of shares bought or sold

‘Trade Log’!$C$1:’Trade Log’!$C$1000 = Column C1 to C1000 of the Trade Log Sheet which is the column where you input your ticker symbol

B16 = The cell where you input the ticker symbol for the stock in the equation

‘Trade Log’!$B$1:’Trade Log’!$B$1000, “Buy” = Column B1 to B1000 of the Trade Log Sheet which is the column where you input the action relevant to the stock. In this case, you are telling the cell to refer to column B of the Trade Log Sheet to search for action “Buy”

‘Trade Log’!$D$1:’Trade Log’!$D$1000 = Column D1 to D1000 of the Trade Log Sheet which is the column where you input the account that holds the stock

W16 = The cell where you input the Account Name for the stock in the equation

Essentially, with this formula, you are telling the cell to look in the Trade Log Sheet for the ticker symbol (B16) and the Account Name (W16) that has the action “Buy” (Column B in the Trade Log Sheet) and deduct amount by the same ticker symbol and Account Name that has the action “Sell”, giving you the final amount of shares that you own.

Cost Basis

=((SUMIFS(‘Trade Log’!$H$1:’Trade Log’!$H$1399,’Trade Log’!$C$1:’Trade Log’!$C$1399,B16,’Trade Log’!$B$1:’Trade Log’!$B$1399,”Buy”,’Trade Log’!$D$1:’Trade Log’!$D$1399,W16))/(SUMIFS(‘Trade Log’!$E$1:’Trade Log’!$E$1116,’Trade Log’!$C$1:’Trade Log’!$C$1116,B16,’Trade Log’!$B$1:’Trade Log’!B$1116,”Buy”,’Trade Log’!$D$1:’Trade Log’!$D$1399,W16)))*$F$6

‘Trade Log’!$H$1:’Trade Log’!$H$1399 = Column H1 to H1399 of the Trade Log which is the column for the total price of the stock purchased/ sold.

If you follow along the explanations above, essentially this lengthy formula is telling the spreadsheet to sum up the total purchase price for a stock divided by the number of shares purchased (which the formula will validate from action “Buy”) giving us the average cost basis. We then multiply this number by the currency exchange rate (which the formula will find from cell F6)

Don’t worry about the currency exchange formula, as it will be explained in future posts.

Current Price

=GOOGLEFINANCE(B16, “Price”)*$F$6

Again B16 is the cell that has the ticker symbol we want the equation to look for

F6 is the currency exchange rate

Today’s Change (in $ and %) & Today’s Change Total

=googlefinance (B13, “change”)

This formula will return today’s change in $ of the stock ticker in cell B13

=googlefinance (B13, “changepct”)/100

By default, Google Sheets will returns this formula as an absolute value, for example 1% will become 100, so I divided by 100 to get the right value.

You would then go to Menu > Format > Number > Percent to get 1%

In order for you to get your Today’s Change Total, simply multiply the cell for Today’s Change (in $) with the cell for # of Shares

Gain/ Loss (in $ and %)

To get your gain/ loss of the stock,

=(Current Price Cell) – (Cost Basis Cell)

and to get the %

=(Current Price Cell) – (Cost Basis Cell)/ (Cost Basis Cell)

and to get the total gain/ loss for that stock, just multiply the cell for gain/ loss (in $) with the cell for # of Shares

Annual Dividend

Brace yourself, this will be one of the lengthiest section of this post. Here goes:

=iferror(iferror(if(B16=””,””,split(index(importhtml(CONCATENATE(“https://finviz.com/quote.ashx?t=”,B16,””),”table”,9),7,2),”*”)),if(isblank(B16),,GETDIVIDEND2(B16,$N$9)))*$F$6,”-“)

B16 = The cell where you input the ticker symbol for the stock in the equation

N9 = The cell where you input your IEX Token Key

F6 is the currency exchange rate

With this formula, you are telling the spreadsheet to find the dividend yield from finviz.com (don’t worry about the table 9, 7, 2. That’s simply where the dividend yield information is located in finviz.com)

The iferror formula is telling the spreadsheet that IF the spreadsheet generates an error return when trying to get the information from finviz, it will switch to another formula where it will get the information from IEX Cloud. IF that also generates an error, then the cell will show “-“.

The formula to get the dividend yield from finviz.com is

=iferror(if(B16=””,””,split(index(importhtml(CONCATENATE(“https://finviz.com/quote.ashx?t=”,B16,””),”table”,9),7,2),”*”)),”-“)

The back up formula is

=if(isblank(B16),,GETDIVIDEND2(B16,$N$9))

This is not a Google Sheets formula but a script that you need to create in Google Sheets. A custom formula so to speak.

In order to create this custom formula, you need to go to Menu > Tools > Script Editor like so:

You will then see a new screen like so

On the right side is where you are going to insert the code. Just copy and paste from this link, click save, name your code whatever you want and your formula is good to go.

Dividend Yield & Annual Income

To get your dividend yield, you need to input into the cell

= (Annual Dividend Cell) / (Current Price Cell)

To get your annual income from that stock, you would use

= (Annual Dividend Cell) x (# of Shares Cell)

And that’s it. You have just finished creating your Stock Portfolio Overview Sheet.

Pat yourself in the back, because this was a long tutorial and you have made it to the end.

As usual, leave a comment or hit me up if you have an suggestions on how you think I can do better or to show how you create your Trade Log.

If you can’t wait and you want to get your hands on the final product as soon as possible, this template is available to purchase from Gumroad.

Also, don’t forget, when you use my referral links, you will be able to claim your free stocks from Robinhood and WeBull. You will help support this blog and I’ll jump and click my heel in gratitude.

]]>
595
The BEST Stock Portfolio Tracker Spreadsheet Ever! – How I Keep Track of My Dividend Growth Portfolio Using Google Sheets https://madhatlab.com/the-best-stock-portfolio-tracker-spreadsheet-ever-how-i-keep-track-of-my-dividend-growth-portfolio-using-google-sheets/?utm_source=rss&utm_medium=rss&utm_campaign=the-best-stock-portfolio-tracker-spreadsheet-ever-how-i-keep-track-of-my-dividend-growth-portfolio-using-google-sheets Thu, 08 Oct 2020 20:30:00 +0000 http://madhatlab.com/?p=546 If you have multiple brokerages/ accounts to manage your investment portfolio, you know keeping track of all of them can be a hassle sometimes.

In this post, I will show you how I use Google Sheets to create an automated portfolio tracker that requires minimal input from the user.

I am planning for this post to be a series where I will break down the features of my spreadsheet in different posts and show you how you can create one of your own from scratch.

Why Have More than 1 Account?

Free stocks, that’s why.

In the past few years, investment brokers are starting to offer free stocks whenever you sign up with them and I am never one to pass up on free money/ assets.

For example, for the month of October, when you sign up for an account on WeBull using the link below and deposit $100, you will get 2 free stocks valued up to $1,600. Even if you ended up not buying any stocks and withdraw the $100, you still get to own the 2 free stocks

You will then repeat this process with Robinhood, where you can get a free stock when you use the link below.

So, in about 15 minutes worth of work, you just get 3 free stocks with virtually no capital.

You can get 1 free stock using the above link

You can get 3 free stocks using the above link

Different Account Serves Different Purpose

Another reason is because you may have a tax advantaged account, retirement account and a regular tax-able portfolio account.

Just from the above reasons, if you are like me, you are going to already have at least 4 accounts which may belong to different brokerages.

Spreadsheet to the Rescue!

Anybody that knows me knows that I am a huge spreadsheet nerd. So, when I couldn’t find a portfolio tracker that ticks all the boxes like I need it, I decided to create my own using Microsoft Excel at first and later, Google Sheets.

I knew when I started my portfolio tracker, I wanted:

  • Low maintenance (preferably once a month or once a quarter) and requires minimal input
  • Cost Basis for my stocks after DRIP (Dividend Reinvestment Program)
  • Number of shares after DRIP
  • Dividend Tracking
  • Deposit/ Capital Tracking
  • The ability to access the spreadsheet anywhere
A dashboard so I can get all my key info in a glance

Portfolio Dashboard

The first page in my spreadsheet is my portfolio dashboard where I can see key information of my portfolio in a glance:

  • Portfolio Value and total gain/ loss
  • Cash available to purchase securities
  • Average dividend yield of the portfolio and the yield on cost
  • Annual income from dividend

I also included key charts and graphs because I like colorful things and charts and graphs allow a different visual perspective of my portfolio.

Charts and graphs include:

  • Holdings by sectors
  • Holdings by companies
  • Monthly dividend income year to year

There is absolutely nothing that I need to input in this sheet and this sheet is strictly for aesthetic value and when I just need to look at key infos.

Capital

Aesthetically, this page still needs some work

The next sheet is the capital page and where I keep track of how much I have invested into the accounts.

Every time I inject more capital into my portfolio, this page is where I record the entry, whether or not I purchase anything with said cash

Stock Portfolio Overview

This sheet lists all my portfolio values and holdings in detail and shows

  • Ticker
  • Number of shares and the cost basis
  • Current price
  • Today Change in price (in $ and %)
  • Total Gain/ Loss (in $ and %)
  • Annual Dividend, Dividend Yield & Yield on Cost
  • Account that purchases the stock
  • Sectors and Assets Type
  • Allocation of the stocks in proportion to the whole portfolio
  • Real time currency conversion based on USD

In this page, I only need to input cash available in each account, the ticker symbol the first time the stock is purchased and the account that purchases the said stock. Everything else will automatically be populated by the spreadsheet.

Lately I have been having problems with Google Sheets’ function to fetch the dividend information, as it keeps on timing out and returning “#N/A” result or errors. To tackle this, I set up 2 back-up functions using add-ons and iex token (which I will elaborate more on how to set up in my next posts).

Essentially when Google Sheets’ function returns an error, the spreadsheet will automatically fetch the dividend information using the iex token method or the “IMPORTFROMWEB” add-on method

I also included a real time currency converter in this page so based on the currency chosen (converted based on USD), every information in this page will be in the selected currency.

In the near future, I’m planning to make the cash part to be populated automatically by the spreadsheet based on the information from the capital sheet

Trade Log

This sheet records all trade transactions that I have done and will automatically update all the information in the stock portfolio sheet.

Every month, I recorded all the reinvested dividend, stock purchase or sales and my cost basis and number of shares will be updated automatically.

Dividend Overview

This sheet is where I keep track of everything dividend in my portfolio.

  • How much dividend I earn by sector
  • How much dividend I earn every month year to year
  • How much dividend I earn by account

Of course I included charts.

I do have to input the monthly dividend manually because I set up my portfolio to reinvest its dividend but my plan is in the near future, even this will be automated based on the information from the trade log sheet.

Future Updates

I constantly update this spreadsheet based on my needs and suggestions from people that use this tracker.

For now, I am planning to include the following in the future updates:

  • Automated available cash information
  • Automated monthly dividend earned information
  • Notifications via email when certain cells (e.g stock price, gain/ loss %) reach a value that interests the user
  • Options contracts

Where Can You Get This Spreadsheet?

Like I mentioned above, I mean to create a series of posts where I will explain in detail how you can DIY this spreadsheet from scratch and this first post is just meant to be a walkthrough of what I am using

But, if you can’t wait or the DIY road is not something that you are interested in, this spreadsheet is also available for purchase via Gumroad.

Also, don’t forget, when you use these links, you will be able to claim your free stocks

As usual, leave a comment or hit me up if you have an suggestions on how you think I can do better.

Update #1: Continue to Part 2 (“Creating a Trade Log”) HERE!

]]>
546