You can use the FIELDVALUE function to retrieve field data from linked data types like the Stocks or Geography data types. There are easier methods for writing formulas that reference data types, so the FIELDVALUE function should be used mainly for creating conditional calculations based on linked data types.
: March 28, 2019: Data types have been released to all Windows Microsoft 365 subscribers. If you are a Microsoft 365 subscriber, make sure you have the latest version of Office.
Technical details
Syntax
=FIELDVALUE(value, field_name)
The FIELDVALUE function syntax has the following arguments:
Argument |
Description |
---|---|
value |
Function returns all matching fields(s) from the linked data type specified in the value argument. |
field_name |
The name or names of the fields you would like to extract from the linked data type. |
Description
-
The FIELDVALUE function returns all matching fields(s) from the linked data type specified in the value argument.
-
The FIELDVALUE function belongs to the Lookup & Reference family of functions.
Examples
In the following basic example, the formula =FIELDVALUE(A2,"Price") extracts the Price field from the stock data type for JM Smucker Co.
The next example is a more typical example for the FIELDVALUE function. Here we're using the IFERROR function to check for errors. If there isn't a company name in cell A2, the FIELDVALUE formula returns an error, and in that case we want to display nothing (""). But if there is a company name, we want to retrieve the Price from the data type in A2 with =IFERROR(FIELDVALUE($A2,B$1),"").
Note that the FIELDVALUE function allows you to reference worksheet cells for the field_name argument, so the above formula references cell B1 for Price instead of manually entering "Price" in the formula.
Remarks
If you try to retrieve data from a non-existent data type field, the FIELDVALUE function will return the #FIELD! error. For instance, you might have entered "Prices", when the actual data type field is named "Price". Double-check your formula to make sure you're using a valid field name. If you want to display a list of field names for a record, select the cell for the record, and press Alt+Shift+F10.
Need more help?
You can always ask an expert in the Excel Tech Community or get support in Communities.
See also
Stocks and geographic data types