In this example, the goal is to retrieve the current stock price for the companies listed in Column B. Note these cells in the range B5:B16 have already been converted to the "Stocks" Data Type. Once the Stocks Data Type is available on the worksheet, you can retrieve various information using the simple formulas described below. These formulas follow a "dot" syntax like this:
With a valid Data Type in A1, Excel will automatically display available fields once the "." is typed.
Note: the Stocks Data Type is only available in Excel 365.
The formula for "Last close" in column C is:
Notice the field name "Previous close" is enclosed in square brackets. This is a requirement for any field name that contains a space character.
The formula for "Last close" in column D is:
The formula for "Change %" in column E is:
This is equivalent to the manual formula:
=(D5-C5)/C5 // manual change %
The FIELDVALUE function can also be used as an alternative to the "dot" syntax formulas above. The equivalent formulas are:
=FIELDVALUE(B5,"Previous close") =FIELDVALUE(B5,"Price") =FIELDVALUE(B5,"Change (%)")
Notice square brackets are not required, but the field names are enclosed in double quotes ("").