Excel: Calculate trading days between two dates

Yesterday a customer contacted us asking if our financial markets data Add-in could calculate the number of trading days between two dates. Unfortunately we don’t have this functionality as implementing it is not as easy as you may think.

You need to take into account weekends, which for most financial markets are Saturday and Sunday. Exceptions to this include several markets in the Middle East such as Saudi Arabia where the working week is Sunday to Thursday and the “weekend” is Friday and Saturday.

You also need to account for market holidays which are usually, although not always, also national holidays.

Fortunately Excel provides the NETWORKDAYS function, which:

Returns the number of whole working days between start_date and end_date. Working days exclude weekends and any dates identified in holidays.

This function can be used, together with a holiday lookup, to provide the functionality we need.

NETWORKDAYS function in Excel

In the example above we are using a holiday list lookup in column D together with the NETWORKDAYS function in cell B4 to compute the trading days between 21 July 2020 and 1 Dec 2020 for the US market.

The NETWORKDAYS function assumes that weekends are Saturday and Sunday. If you wish to specify a different weekend then you can use the NETWORKDAYS.INTL function.

Building an IG Index watchlist in Excel

Excel Price Feed Streaming Watchlist

IG Index / IG Markets provides over 16,000 different markets to trade, including FX, stocks, indices, commodities and cryptocurrencies. Keeping track of potential trading opportunities within this universe is daunting, you really need a way to filter out which markets you are interested in and monitor just those markets.

This is where watchlists can help.

They help you focus on only the markets that interest you and help quickly give you an overview of the overall financial market. For example, I like to monitor a watchlist of major stock indices, currency pairs and commodities. This is especially helpful when I first arrive at my desk in the morning and want to get a quick overview of global market sentiment.

Brokers, such as IG Index, provide basic tools for building watchlists, for example here is an extract from one of my watchlists on the IG website:

IG Web Platform Watchlist

This watchlist is fine for keeping an eye on a small selection of fields such as % day change but what if you want a more customized watchlist, with filters, sorting, visualizations, custom formulas etc?

This is where the Excel Price Feed Add-in comes in.

You can use the power and customisation of Excel using formulas and visualizations together with the live market data formulas provided by the Add-in to build your own watchlist in Excel.

For example, we can use the daily high and low price to calculate the daily range and visualize where the current price is within the daily range.

In the example below I can see that the current level of the S&P500 is near the high of the daily range (83%) and the range today is 70 points:

We can add more markets and more data, including client sentiment, to give us a live view of the market, highlighting the data we are interested in:

At a glance we can see that the major stock indices are little changed on the day and towards the high of their daily ranges. We can also see that the main mover today is the cryptocurrency Ether.

Using Excel like this we can track and compare markets exactly the way that suits our trading style. Once we have setup our spreadsheet it is updated automatically with live market data so it always gives us a live view of the market.

Download Excel Price Feed today and try it for yourself.