- value - The data type with field values.
- field_name - The field name provided as a text value.
The Excel FIELDVALUE function extracts a given field value from a Data Type. The field is specified by name and provided as a text value. Use the FIELDVALUE function to retrieve a field value by name from linked data types like Stocks, Geography, Food, Currency, and more.
To retrieve a field value from a linked data type, provide the field name as text in double quotes (""). For example, with a city in cell A1, linked to a Geography data type, you can request population data like this:
In the example shown, the formula in cell C5, copied down, is:
The result is population data for the 12 cities listed in B5 to B16.
The FIELDVALUE function is an alternative the "dot" syntax for retrieving a field value from a data type. The two formulas below return the same result:
Note square brackets () are required for field names that contain spaces:
=FIELDVALUE(B5,"city population") =B5.[city population]
When the field name is a single word, the brackets are not required
In column D of the example, FIELDVALUE is used to extract "Area" like this:
This returns a #FIELD! error for cities where area is not available. To trap this error and return an empty string ("") where there are errors, the IFERROR function is used in cell D5 like this:
As a result, the cells for Cairo, Beijing, Istanbul, and Mexico City display nothing instead of a #FIELD! error.