RTD Function

An Excel Lookup and Reference function that is used to retrieve real-time data and information from external sources that is in accordance with COM automation.

Author: Devang Shekhar
Devang  Shekhar
Devang Shekhar
I am a third year undergraduate at Indian Institute of Technology Kharagpur, enthusiastic about Finance, Economics, Data Analytics and Entrepreneurship.
Reviewed By: Parul Gupta
Parul Gupta
Parul Gupta
Working as a Chief Editor, customer support, and content moderator at Wall Street Oasis.
Last Updated:May 20, 2024

What is the Real-Time Data RTD Function in Excel?

The Real-Time Data (RTD) function is an Excel Lookup and Reference function that is used to retrieve real-time data and information from external sources that is in accordance with COM automation.

COM automation is a process that enables the automatic execution of the tasks generally selected from menus. 

COM stands for Component Object Model. For the RTD function, Excel utilizes COM automation to communicate with the corresponding automation server and retrieve real-time data.

For example, a small program could be written to extract data from a database provided, which could be pasted into a spreadsheet where the data can be charted, graphed, and summarized for detailed analysis without any manual intervention.

In financial analysis, the RTD function is important as it helps release values from the real-time data servers in our Excel spreadsheet. 

It is used to build reliable refreshable data sheets quickly and models using the cell values as function arguments.

By leveraging the RTD function derived from COM technology, users can enhance the robustness, reliability, and convenience of their work in Excel. This is especially beneficial when working with worksheets that require real-time data updates. 

This function depends on the availability of an RTD server for Excel to access real-time data.

If an RTD server is available, the RTD function retrieves data from the server to use in the Excel worksheet. Whenever the data is modified or new data is added from the server, the function result is updated so that the worksheet can extract and accept the data.

The RTD server updates the data only when Excel is idle. So the user does not have to determine whether Excel is available to accept the updates. 

This property distinguishes the RTD function from other Excel functions because other functions are updated when the worksheet is recalculated.

The formula for using the Real Time Data function in Excel is as follows:

=RTD(ProgID, ServerName, topic1, [topic2],....)

The terms in parentheses are called the arguments of the function. These are the values that the function requires to perform the computations and calculate the desired result. The arguments that the RTD function in Excel requires are:

  1. ProgID: This is a required argument in the RTD function. It is a string argument that refers to the program ID of the RTD server on the local system. It is a COM add-in registered by a setup procedure. It must be enclosed within double quotes(“”).
  2. ServerName: This is a required argument. It is a string argument that refers to the name of the server on which the RTD server is executed. 
    • If the server is executed locally within the system, this argument should be an empty string(“”) or may be left blank. The name should always be enclosed within double quotes.
  3. Topic1, [Topic2],....: Here, topic 1 is a required argument, while the successive topics are optional and can be omitted. These are the strings that determine the data to be retrieved. 

Key Takeaways

  • The RTD function is used to fetch real-time data from a COM automation server in Excel. This allows users to display dynamic data that updates automatically.
  • The RTD function returns real-time data from the specified COM automation server based on the provided topics.
  • The RTD function is commonly used in financial markets for real-time stock quotes, forex rates, and other financial data. It can be used in manufacturing, logistics, or any other field that requires monitoring of real-time data feeds.
  • If the specified COM add-in is not registered or cannot be found, the RTD function will return a #N/A error. Errors may also occur if the topics are invalid or the server is unreachable.

Examples of the RTD Function in Excel

Having examined the theoretical concepts related to the RTD function in Excel, let's examine an example to understand its practical applications.

Suppose we need to retrieve information from a server delivering continuous data for the total marks scored by students in different subjects. The server is pre-installed on the user’s computer and is registered as a COM add-in by an internal setup procedure. 

The general form of the RTD function used in this case is as follows:

=RTD(“ProgID”, “ServerName”, “StudentName”, “RollNum”, “SubCode”, “Marks”)

There are three topics in this case:

  • The topic StudentName indicates the name of the student.
  • The topic RollNum indicates the roll number of the student.
  • The topic SubCode indicates the subject code of the subject whose marks we want to know.
  • The topic Marks indicate the marks obtained by the particular student in a particular subject.

Assuming the server is pre-installed and executed on the local computer, we provide an empty string(“”) in the ServerName argument. 

To retrieve information about a student, the user may select any cell and input the following formula:

=RTD(“ExcelRTD.StudentReport”, “”, “John”, “23CH4468”, “HS8194”, “Marks_John”)

Here ExcelRTD.StudentReport is the program ID of the server provided. The above formula is used to see the marks in the subject with code HS8194 of a student named John, whose roll number is 23CH4468. 

The RTD function can retrieve numbers and any information from the dataset we want. Hence we can use the RTD function throughout the Excel worksheet to retrieve different data from the server. The data retrieved is updated automatically.

These user-defined functions act as wrappers for the RTD function. This method helps users shield themselves from the RTD server name and program ID details. It enables the user to focus only on the data important to them.

For example, we could have used the GetMarks(SubCode) function in the above scenario. This function assumes that the user is dealing with the same server and student and intends to retrieve marks in different subjects of the same student. 

To get the desired data, the user has to provide the subject code of the subject whose marks he wants to know.

Before using the RTD function, the RTD COM automation add-in must be installed on the local computer. 

The RTD servers are not synced with Microsoft Office, so a real-time data server must be manually installed to use the function. 

The RTD function continues to retrieve information even if Excel is in manual calculation mode, as the RTD server updates data when Excel is idle. 

The new data is retrieved in this case, and the current values are used in the manual calculations performed.

The RTD servers must be digitally signed. If an RTD server is not digitally signed, the server does not load properly, and the function shows a #N/A! Error in the cells referencing the RTD server.

Free Resources

To continue learning and advancing your career, check out these additional helpful WSO resources: