HomeGoogle DocsSpreadsheetAdd Field Label to Array Formula Result in Google Sheets

Add Field Label to Array Formula Result in Google Sheets

Published on

In Query, there is an option (clause) to name or rename field labels (column names). I think no other functions have that cool feature. But it’s easy to add field label to array formula result in Google Sheets.

In the below examples, you can see how to add field labels aka column names to single as well as multiple column array outputs.

Some times you may also want to add a label to a single cell formula output to plot a chart. So that part also I will include in this tutorial.

Must Read: Column Heading | Column Label | Column Name | Field | Field Label in Google Sheets.

Adding Field Label to a Single Cell Formula Output (Non-Array Formula Output)

To add field labels you must use the Curly Braces. I think instead of giving you more details, the best way is showing you a screenshot.

Formula # 1:

={"Salary";B2:B10*C2:C10}
Adding Column Label to a Single Cell Formula Result

Normally to get the salary of the employee “Alex”, you can use the formula B2*C2 in cell D2.

Here I want to add the column name “Salary” to that output. The formula added in cell D1 does that correctly.

See how I have used the Curly Braces. The column name is within double quotes as it’s a string and put a semi-column between the formula and the column name.

Using the semi-colon may not work if you are from any of the EU countries. Check the following tutorial for more info on this – How to Change a Non-Regional Google Sheets Formula.

Finally, the formula is wrapped by the Curly Braces. This is what you want to follow with array formula outputs too.

Adding Field Label to Single Column Array Formula Result in Google Sheets

Several functions in Google Sheets can return a single column output. A few of them are ArrayFormula, Filter, Sort, and Sortn. Here also, you can follow the above same method to add a column name to the first row.

Here are two examples. One with ArrayFormula and another with the function Filter.

How to Add Column Name to a Single Column ArrayFormula Output

I am adding more rows to the data used in the earlier formula example. See that data and the formula first.

Formula # 2:

=ArrayFormula({"Salary";B2:B*C2:C})
Add Field Label to the First Row of a Single Column ArrayFormula

The formula is almost the same as Formula # 1. The only difference is the inclusion of ArrayFormula and the infinite column ranges.

The formula returns additional values in row # 11, 12 and 13. To omit that simply modify the formula # 2 as below.

=ArrayFormula(if(A1:A<>"",{"Salary";B2:B*C2:C},))

How to Add Field Label/Column Name to Filter Output

Assume you want to extract the name of the employees whose basic salary is 4500. Here you can use the Filter function.

Here I am adding column name to the filter formula output.

Formula # 3:

={"Name";filter(A1:A,B1:B=5500)}
Get Column Name in Filter Function in Sheets

I have added the column name “Name” to the top row of the Filter formula result.

Finally, I am going to use the above formula to return a four column output. I mean the Name, Basic, Present Days and Salary of employees whose basic pay is 4500.

Adding Column Name to Multiple Column Output in Google Sheets

Formula # 4:

={"Name","Basic","Present Days","Salary";filter(A1:D,B1:B=5500)}
Add Field Label to a Multi-Column Array Formula Result

Interestingly you can use corresponding cell references in the above formulas to add field labels. As an example, you can replace the last formula with the following formula.

={A1:D1;filter(A1:D,B1:B=5500)}

That’s all for now. Hope you have enjoyed the stay!

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Dynamic Sum Column in SUMIF in Google Sheets

To obtain a dynamic sum column (sum_range argument) in SUMIF, we can utilize the...

Create a Calendar in Excel with a One-Line Dynamic Array Formula

This tutorial explains how to create a calendar in Excel using a one-line formula...

Excel: Month Name to Number & Number to Name

This tutorial showcases the most efficient formulas for converting a month name to a...

Get the First or Last Row/Column in a New Google Sheets Table

If you've recently started using the new Google Sheets TABLE functionality, you may find...

More like this

Dynamic Sum Column in SUMIF in Google Sheets

To obtain a dynamic sum column (sum_range argument) in SUMIF, we can utilize the...

Get the First or Last Row/Column in a New Google Sheets Table

If you've recently started using the new Google Sheets TABLE functionality, you may find...

UNIQUE Function in Visible Rows in Google Sheets

The UNIQUE function doesn't inherently include only visible rows when it returns values, discarding...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.