Skip to main content

Posts

Compare stock portfolio to compound interest saving account

In investing, it is important to define the target that we want to achieve. Many investors like to compare their portfolios with a market index, but is outperforming the market index a good target? It is not a quantitative target to be measurable as market indexes fluctuate daily. I, personally, aim only for 10% growth a year. If at the end of the year, I see my portfolio grows 10%, I am pleased with that result no matter that S&P500 grows 50% the same year. To see if my stock portfolio grows in line with the 10% target, I choose to compare it to a saving account with the same interest. In this post, I will show you how to use a fictive saving account with daily compound interest as the target to benchmark a stock portfolio. Idea Computation Visualization Evolution of target saving account with 5% annual compound interest Evolution of target saving account with 10% annual compound interest Evolution of target saving account with 15% annual compound interest Conclusion
Recent posts

Stock Correlation Analysis With Google Sheets

Correlation is a statistical relationship that measures how related the movement of one variable is compared to another variable. For example, stock prices fluctuate over time and are correlated accordingly or inversely to one another. Understanding stock correlation and being able to perform analysis are very helpful in managing a stock portfolio investment. In this post, we will look at how to perform stock correlation analysis with Google Sheets. Understanding correlation and its applications in stock investing Stock correlation analysis with Google Sheets Getting started User guide Conclusion Disclaimer Understanding correlation and its applications in stock investing The most familiar correlation measure is the Pearson product-moment correlation coefficient . The strength of the relationship between two variables is expressed numerically between -1 and 1. For example: Two stocks are positively correlated when their prices always go up or go down together. Their co

How to convert column index into letters with Google Apps Script

Although Google Sheets does not provide a ready-to-use function that takes a column index as an input and returns corresponding letters as output, we can still do the task by leveraging other built-in functions ADDRESS , REGEXEXTRACT , INDEX , SPLIT as shown in the post . However, in form of a formula, that solution is not applicable for scripting with Google Apps Script. In this post, we look at how to write a utility function with Google Apps Script that converts column index into corresponding letters. With the solution in the form of a formula , we don't even need to understand how column index and letters map each other. With apps script, we need to understand the mapping to come up with an algorithm. In a spreadsheet, columns are indexed alphabetically, starting from A. Obviously, the first 26 columns correspond to 26 alphabet characters, A to Z. The next 676 columns ( 26*26 ), from 27th to 702nd, are indexed with 2 letters. [AA, AB, ... AY, AZ], [BA, BB, ... BY, BZ],

How to convert column index into letters with Google Sheets

In Google Sheets, rows are indexed numerically, starting from 1, but columns are indexed alphabetically, starting from A. Hence, it is pretty straightforward to work with rows and trickier to work with columns as we need to convert between column index and corresponding letters. For example, what are the letters of column 999th in Google Sheets? In this post, we will look at how to convert a column index into its corresponding letters by using the built-in functions of Google Sheets. What are letters of the column 999th in a spreadsheet? Unfortunately, Google Sheets does not provide a ready-to-use function that takes a column index as an input and returns corresponding letters as output. However, there is a little trick of combining other available built-in functions to do the task. In Google Sheets, there is the ADDRESS function that returns the cell reference, according to the specified row index (first parameter) and column index (second parameter) in the input. For example

How to copy data in Google Sheets as HTML table

I often need to extract some sample data in Google Sheets and present it in my blog as an HTML table. However, when copying a selected range in Google Sheets and paste it outside the Google Sheets, I only get plain text. In this post, I explain how to copy data in Google Sheets as an HTML table by writing a small Apps Script program. Concept Source Code Getting Started Concept Write a small Apps Script program copyAsHTMLTable() to transform the selected range in the active sheet into a HTML code for table According to Apps Script documentation, getActiveRange() returns the selected range in the active sheet. According to Apps Script documentation, getDisplayValues() returns the rectangular grid of values for a range. From the rectangular grid of values: Use 2 for loops to iterate row by row and then column by column Each row is wrapped in a HTML row tag <tr></tr> Each column is wrapped in a HTML column tag <td></td> Present the HTML table co

LION stock portfolio tracker - Release Announcement

I am happy to announce the release of LION stock portfolio tracker. It is a personal stock portfolio tracker built with Google Sheets and Google Data Studio. The stock portfolio's transactions are managed in Google Sheets and its performance is monitored interactively on a beautiful dashboard in Google Data Studio. You can try with the demo below and follow the LION stock portfolio tracker guide to create your own personal stock portfolio tracker with Google Sheets and Google Data Studio. Demo dashboard Demo spreadsheet Guide Disclaimer Demo dashboard Demo spreadsheet Guide LION Stock Portfolio Tracker - Guide Disclaimer The post and the LION stock portfolio tracker are only for informational purposes and not for trading purposes or financial advice. It is your responsibility to use the LIO

Create personal stock portfolio tracker with Google Sheets and Google Data Studio

I have been investing in the stock market for a while. I was looking for a software tool that could help me better manage my portfolio, but, could not find one that satisfied my needs. One day, I discovered that the Google Sheets application has a built-in function called GOOGLEFINANCE which fetches current or historical prices of stocks into spreadsheets. So I thought it is totally possible to build my own personal portfolio tracker with Google Sheets. I can register my transactions in a sheet and use the pivot table, built-in functions such as GOOGLEFINANCE, and Apps Script to automate the computation for daily evolutions of my portfolio as well as the current position for each stock in my portfolio. I then drew some sort of charts within the spreadsheet to have some visual ideas of my portfolio. However, I quickly found it inconvenient to have the charts overlapped the table and to switch back and forth among sheets in the spreadsheet. That's when I came to know the existenc

Compare stock portfolio to market indexes

As investors, we always want to see our portfolio grows over time. If a portfolio made a 1000$ of gain in one year, is it good enough? Should we gauge the portfolio's performance against an alternative investment, for instance, a market index? Should we aim to beat that index? In this post, we will see how to compare a stock portfolio to market indexes by using Google Sheets, Apps Script, and Google Data Studio. Select market indexes to compare Method to compare Guides Prepare data with Google Sheets and Apps Script Visualize benchmark in Google Data Studio Demo Conclusion Note References Disclaimer Select market indexes to compare In the context of stock investment, investors can compare the performance of their portfolios over a period of time with an alternative investment such as a market index, a portfolio of another investor, or even a single stock if they don't want any diversification, etc. In general, a market index is a good benchmark because i