TOP

Stock Function

STOCK() Description

The STOCK() function is designed to automatically obtain stock prices directly from the Yahoo Finance website (finance.yahoo.com) by the specified ticker symbol (for example, AAPL, NVDA) and the selected date. It supports both historical quotes and current real-time values.

This function is convenient for creating stock trackers in Excel (LibreOffice Calc) spreadsheets and will be useful for investors, traders, and financial analysts.


An internet connection is required for this function to work.

Key Features of the STOCK Function

Syntax:

=STOCK(Ticker; [Date]; [Indicator])

Parameters:

Usage Example

Example 1

The STOCK() function is easy to use. You just need to specify the cell with the stock code and Excel (Calc) will automatically import its price for the given date:

=STOCK(Ticker; Date)

We will have the following result:

Example of using the STOCK() function
Example of using the STOCK() function

The following values are used in this example:

Example 2

Example of using the STOCK() function
Example of using the STOCK() function

The following values are used in this example:

Relevant data from the Yahoo Finance website:

STOCK formula usage

How Does It Work?

The STOCK() function can work both in normal mode and as an array function.

To use it as an array, simply enter the function into any cell, specifying the appropriate parameters. Then press Ctrl+Shift+Enter to enter the array formula, and LO Calc will automatically return a table with the data.

To select all cells associated with the array formula, simply select any cell in the array and press Ctrl+/.

If you need to convert an array formula to values - select the entire array and in the Data > Calculate menu, select Formula to Value.

When using a date in text format, it must first be converted into a real date, for example: DATEVALUE("2026-01-25").


If you need to get historical data for a long period, we recommend using the YFINANCE function to avoid delays.

Ready-made templates

You can also use ready-made templates to get historical data, financial indicators, or a company profile.

To do this, go to the YLC Utilities > Template > Company screener menu and choose one of the following reports:

Download the extension

You can use the STOCK() function by installing the YLC Utilities extension.

After that, this function will be available in all files opened in Excel (LibreOffice Calc).


This function is available in the following extensions: YLC FunctionsYLC Utilities

The YLC Utilities menu in LO Calc

The YLC Utilities menu in LO Calc

The YLC Utilities menu in Excel

The YLC Utilities menu in Excel