Recent Microsoft Excel Performance Improvements

The latest release of Excel is focused on performance improvements. The main areas that have been addressed are RealTimeData functions, faster opening of workbooks with many user defined functions and faster aggregation.

RealTimeData functions (RTD) are commonly used to update a spreadsheet from a real-time data source. For example, if you have a stock portfolio you can add RTD functions to your sheet to provide real-time prices: as the stock moves, the price in the Excel cell is updated automatically:

Microsoft has removed bottlenecks in the underlying memory and data structures and also made it “thread safe”. The result is a significant performance improvement on sheets with lots of RTD functions.

I have noticed with one of my testing spreadsheets, with lots of RTD functions, that Excel now consumes less CPU and is generally more responsive.

User Defined Functions (UDFs) are custom functions that can be created by users or provided by an Add-in to add additional functionality to Excel. These functions operate the same as regular functions/formulas.

Opening workbooks with many UDFs was previously very slow as Excel looked up each UDF on the sheet. Now, Excel includes a UDF cache to make this process much faster.

Aggregation functions like SUMIFS, COUNTIFS, AVERAGEIFS, MAXIFS, MINIFS are some of the most commonly used Excel functions. With the latest release of Excel the performance of these functions is drastically improved.

Don’t forget, to take advantage of these recent improvements you must be subscribed to the Microsoft 365 monthly or semi-annual channel.

Partnership Announcement: EODHistoricalData.com

We are pleased to announce today our partnership with data provider EODHistoricalData.com which provides comprehensive historical and fundamental data from 60+ exchanges around the world.

This partnership significantly increases the data coverage of Excel Price Feed especially fundamental data as we can now offer up to 20 years of company financial history for many stocks.

For example, here is an extract of the Financial Analysis tab for Microsoft stock from our sample spreadsheet:

Excel Price Feed is unique in the way it enables financial data to be embedded in a spreadsheet using simple Excel formulas, no more VBA or complicated web requests.

For example, to add the current market capitalization of Apple stock to a cell, the following formula is used:

=EPF.EOD.MarketCapitalization("AAPL.US")

Then, each time the spreadsheet is refreshed the latest data is retrieved.

Company fundamental data that is now easily available in Excel via the Add-in includes current market capitalization, EBITDA, PE Ratio and PEG Ratio:

Our launch integration includes historical price data (daily, weekly and monthly) as well as stock fundamental data and financial analysis data. Over the coming months we will be adding access to more datasets such as technical indicators, economic and calendar data. We will also expand our instrument coverage to include more bonds and options.

To get started visit the EODHistoricalData.com Overview & Setup page on our website.

Subscription plans for EODHistoricalData.com start from €19.99 per month.

IG Client Sentiment Analysis

IG client sentiment is an indicator that IG Index provides to show what percentage of clients have long or short positions.

For example looking at the NASDAQ index, we can currently see that 56% of clients are long this market and 44% are short:

NASDAQ IG client sentiment

A general consensus is that this is often a “contrarian” indicator, clients try to short when the market when it is going up and go long when the market is going down.

The Excel Price Feed Add-in provides historical client sentiment data which you can download into Excel. You can then combine this data with historical market data to see how client sentiment changes as the market changes.

Here is a chart of long client sentiment (the orange line) versus market daily close (the blue line) for the S&P500 Index over the past 4 months:

S&P500 IG client sentiment

There does appear to be a correlation, as the market moves up client long positions moves down – clients are moving from long to short positions as the market goes up.

Then at the peak (early September) client positions were long just before the market started dropping.

As the market moved down (i.e. for the past month) clients stayed long.

This example shows that client sentiment data can be used to provide trading signals, especially at “turning points” in sentiment. Obviously this would need to be tested against different markets but it is definitely a useful tool when looking for trading opportunities.

Volatile Excel Functions

Today I was talking to a customer and his issue was a strange one which I hadn’t seen before.

Every time he changed ANYTHING on his spreadsheet he noticed that it would refresh unrelated formulas, i.e. formulas that did not reference the cells he was updating.

The main formula on his sheet was this:

=EPF.Yahoo.HistoricDatePeriod("AMD","Weekly","1 Jan 2020", TODAY(), "DESC", 1)

This is an Excel Price Feed dynamic array formula which returns weekly historical stock market data for AMD stock from 1 Jan 2020 to today.

This formula is non-volatile so should only update when any of its parameters change.

So, what was going on?

The culprit was actually one of the parameters: the Excel TODAY() function.

This built-in Excel function is a volatile function and will update ANYTIME ANYTHING on the spreadsheet changes.

What is a Volatile Function?

Microsoft defines a volatile function as follows:

…one whose value cannot be assumed to be the same from one moment to the next even if none of its arguments (if it takes any) has changed.

https://docs.microsoft.com/en-us/office/client-developer/excel/excel-recalculation

There are 8 built-in volatile Excel formulas, and it is worth being aware that using these in your spreadsheet could have unintended consequences:

  • NOW
  • TODAY
  • RANDBETWEEN
  • OFFSET
  • INDIRECT
  • INFO (depending on its arguments)
  • CELL (depending on its arguments)
  • SUMIF (depending on its arguments)

The Solution

The solution was simple, replace the TODAY() function with a string value of the current date. This could be either hardcoded into the formula or better still entered into a cell and referenced from the formula.

So, if you every notice your spreadsheet starting to slow-down or start doing unnecessary calculations then look out for volatile functions.

Pre-market stock prices

Stock markets are generally only open during specific times, the “trading day”. For example, the US market is open from 9:30am to 4:00pm (EST).

However, this is not the only period when trading takes place and when prices can change, there is also the pre-market which is “open” before the regular market opens.

This is a time of very little liquidity however trading during this time can enable you to take advantage of any news or events that happen outside normal market hours.

Yahoo Finance provides prices during this period, the pre-market (or before hours) prices.

For example, below we can see the current “before hours” price for Apple stock is 364.00 and the price has moved -2.53 from yesterdays close price of 366.53:

Apple stock price: live and pre-market

We have recently added some new Excel formulas to the Add-in to provide pre-market prices in Excel:

  • EPF.Yahoo.PreMarketPrice
  • EPF.Yahoo.PreMarketChange
  • EPF.Yahoo.PreMarketChangePercent
  • EPF.Yahoo.MarketState

This last formula is used to find the current state for the market eg. whether we are in regular or pre-market trading hours: “REGULAR” or “PRE”.

The example spreadsheet below shows the formulas in action, you can see column C uses the PreMarketPrice formula which references the ticker in column A:

Excel Price Feed pre-market stock prices

We hope you find these new formulas useful and as ever keep your feedback coming, preferably on the Support Forum or leave a comment below.