close
The Wayback Machine - https://web.archive.org/web/20240927194450/https://www.geeksforgeeks.org/array-formulas-in-excel/
Open In App

Array Formulas in Excel

Last Updated : 14 Feb, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Excel is among the most powerful and widely used spreadsheet tools which eases organizing numbers and data within the sheets with pre-built formulas and functions. In this article, we are going to study Array Formulas. Arrays are one of them. Using Excel Array Formulas, make it super easy to handle a lot of data. Before understanding and using the Array formulas, let’s first understand what is Array in Excel?

Array in Excel

An Array in Excel is the structure that holds a collection of data. These data can be in the form of numbers or texts. There could be an array of 1-D or 2-D as well in Excel. For example, the array of fruits in excel would be written something like this:-

{“Apple”, “Banana”, “Grapes”, “Guava”}

We can directly enter it into the sheet by selecting the cells where you want to enter the data and then writing the array preceded by an “=” sign.  After these press Ctrl+Shift+Enter. For example, let’s enter these values in cells A1 to D1.

Array-in-excel

 

The array created here is a horizontal array. You can also create a vertical array by changing the selected cells. You can create an array by specifying the starting and the ending positions, for example, if you wish to make an array of elements between A1 to F1 then you can write A1:F1. Now. let’s move to array formulas.

Array formulas

Array formulas enable to process of several values and give several outputs. In a simple world, it can do multiple calculations and reduce a lot of human efforts. In other words, we can say that it solves array calculations and give an array as output too. Let’s understand more of them with an example, of students with their test marks,

Sample-data

 

Here, we have used a formula to evaluate the result in the ‘Total’ field. For inserting the formula, click on the cell where you want to store the answer and write the formula. Now, let’s try to calculate the same for all students

Using-Array-formula

 

For calculating the total for all the students, select the field where you want to store them, now select the range, and insert the formula. Array formulas are available in every version of Excel, so you don’t worry about your excel version. There are hundreds of operations possible using array formulas, which we will discuss in this article later. But before proceeding let’s understand what is the need to use an array formula.

Why use an Array Formula?

Array formulas are to most powerful yet most easy-to-use calculation tools which could be used to perform complex calculations and take place of hundreds of formulas with a single formula. You can further specify conditions for the calculation of data. Not just calculations you can also count the chars in cells, add date, day, or time, and even pick random data. 

How to insert an Array Formula?

Before entering the Array formula fir of all we understand some important points about the Array formula:

  • After typing the formula you have to press keys CTRL+SHIFT+ENTER together. It will automatically change the normal formula into an array formula. 
  • If you manually type braces around the formula then it will not convert the formula into an array formula. You have to use CTRL+SHIFT+ENTER keys to convert the formula into an array formula.
  • Whenever you edit the array formula the braces will disappear automatically and you have to again press the combination of CTRL+SHIFT+ENTER keys.
  • If you forget to press the CTRL+SHIFT+ENTER keys then your formula will work as the normal formula.

Now let’s understand inserting an array formula.

Single Cell Array formula

Every array formula returns the result in either single or in multiple cells. So when an array formula returns its result in the single-cell then such type of formula is known as a single-cell array formula. Such types of formulas are SUM, AVERAGE, AGGREGATE, MAX, MIN, etc. Follow the following steps to use the single-cell array formula:

Step 1: Select the cell where you want to store the answer.

Step 2: Now go to the formula bar and write an “=” sign.

Step 3: Now to formulas (highlighted below), and select the operation you want to perform.

Single-cell-array

 

Step 4: Here we want to perform the sum operation. Click on sum and a new popup will open. Write the cells you want to perform the operation with.

Function-arguments

 

Multi-Cell Array Formula

If you wish to perform the same calculation with more cells then you can use the multi-cell formula. You can implement it in two ways. Functions like TRANSPOSE, TREND, FREQUENCY, LINEST, etc are used for the multi-cell arrays. Implement the formula in single-cell by following the above steps. Now, drag the selection up to the cells you want to implement the formula. Below is the implementation of doing that.

Multi-cell-array-formula

 

Alternatively,

Specify the range of cells and an operator between them. For example, =(B1:B7 + C2:C7) and press Ctrl+Shift+Enter. 

Operator-in-multi-cell

 

Excel Array Constants

Excel array contacts are a set of static values and can’t be changed. These values remain constant regardless of the operations performed on them. Now we will see how to create Array Constants in Excel and will perform different actions on them. There are three types of array constant available:

1. Horizontal or Row Array constant

A horizontal constant is present in a row. To create a horizontal constant we have to type multiple values separated by a comma in the enclosed braces. To enter a row array follow these steps below:

Step 1: Select the cells you want to work with.

Step 2: Go to the formula bar and start with an equal sign. 

Step 3: Now enter the array you want to create in braces {}, separated by commas(,). Ex:- ={1,2,3,4,5}

Step 4: Now press Ctrl+Shift+Enter.

Horizontal-or-Row-Array-constant

 

2. Vertical or Column Array

Vertical array constants are generally present in Column Array. To create a vertical constant we have to type multiple values separated by a semicolon in the enclosed braces. To enter a column array follow these steps below:

Step 1: Select the cells you want to work with.

step 2: Go to the formula bar and start with an equal sign. 

Step 3: Now enter the array you want to create in braces {} separated with termination sign(;). Ex:- ={“Coding”;”GFG”;”GeeksforGeeks”}

Step 4: Now press Ctrl+Shift+Enter.

 Vertical-or-Column-Array

 

3. 2-D array

In Excel, you are allowed to create a 2-D array. So to create a 2-D array constant, we have to type multiple values in which rows are separated by semicolons and d columns are separated by commas. Let’s understand the implementation of a 2-d array. 

Step 1: Select the cells you want to work with.

Step 2: Go to the formula bar and start with an equal sign. 

Step 3: Now enter the array you want to create in braces {} separated with commas(,) for entering the values in same row, termination sign(;) for row change. Ex:- ={1,2,3;”Coding”,”GFG”,”GeeksforGeeks”}

Step 4: Now press Ctrl+Shift+Enter.

Working with Constant arrays

In the Excel formula, array constants are the important part. Some of the important concepts of Array constant are:

1. Elements: To create elements of array constant we have to follow the following points:

  1. The elements of an array constant must be of numeric, alphabetic, boolean, or scientific notation and each of them is separated by commas or semicolons.
  2. The elements of an array constant do not contain an array, cell reference, dates functions formulas, defined names, etc.
  3. You can also be allowed to use text in the array of the element but the text is surrounded by hyphens(“”). 

2. Naming Array Constants: You can name any array and use them as a variable for further references. For naming an array, follow the steps below:

  1. Go to the formula tab. and select Define Name.
  2. Write the array name in the name. You can also add some comments related to your array.
  3. Click on OK.
BERJAYA

 

3. Common Errors: Following are the common errors that will happen while working with array constants:

  1. The use of delimiters in between the elements.
  2. The selection of range is also an important point to remember. 

Unary Operator in Excel Array Formulas

Using unary operators we can process the array using AND and OR operators. 

  1. AND: It is denoted by an asterisk(*) symbol. It returns true if and only if all conditions are true, 
  2. OR: It is denoted by a plus(+) symbol. It returns true if any of the statement is true.

These operators are more useful when you have the same variable with a different value. For example, let’s consider a case, where data of 3 sellers of different months are given and you have to how much Shyam sold potatoes.

Using-and-operator

 



Similar Reads

How to calculate Sum of Digits in a Number using Non Array Formulas in Excel?
In Excel, we can easily add the digits of a number. Usually, calculations that involve multiple values can be dealt with the help of array formulas, but here, we are going to find the sum of the digits of a number using non-array formulas. As an example, say we have a number 238 in one of the cells of the Excel sheet and we want to find the sum of
4 min read
Dynamic Array Formulas in Excel
Dynamic arrays are resizable arrays that calculate automatically and return value into multiple cells based on a formula entered in a single cell. The new array (multiple cells) that we get is known as spilling and the new array has been placed in neighboring cells. It is not necessary to use Ctrl + Shift + Enter to enter an array formula. Dynamic
2 min read
Basic Excel Formulas
Functions in Excel are the predefined formulas that have their specific meaningful work. They make our task easy and quick like finding the sum, count, average, maximum value, and minimum values for a range of cells. For example, the SUM function will calculate the sum of the range passed to it as an argument. Functions increase productivity while
1 min read
How to calculate Sum and Average of numbers using formulas in MS Excel?
Everyday in school, offices, business sectors or any other field lots of information are there that are required to store for future use. For anyone, it is very difficult to remember that information for a long time. Earlier data and information are stored in a form of a register, file, or by paperwork but finding it may be difficult for us. It tak
4 min read
Excel Formulas not Working, not Calculating: Quick Ways to Fix Them
Microsoft Excel is a spreadsheet application that has been used by millions of people worldwide for more than three decades. Pivot tables, graphing tools, calculations, and a macro programming language are included. In contrast to other apps such as Word, spreadsheet software calculates values using mathematical formulas and data in cells. However,
7 min read
6 New Functions or Formulas in Excel 2019
A formula is a mathematical expression that computes a cell's value. Functions are predefined formulas found in Excel. Based on the values specified as arguments or parameters, functions perform specific calculations in a specific order. For instance, =SUM (C1:C10). This function adds the values from cells C1 to C10. In the math and trigonometry, s
6 min read
How to Use ChatGPT to Write Excel Formulas
Worrying about mastering Excel formulas? Thinking about the right syntax and function for hours? If you are, ChatGPT has got you covered! Discover how ChatGPT makes Excel formula writing effortless in the following article. In data analysis, Excel formulas reign supreme as a crucial tool. They make it possible to manipulate data, perform calculatio
5 min read
How to Show Formulas in Excel
Exploring the art of Excel formulas can turn up your data analysis and reporting capabilities. Whether you’re a financial analyst, digital marketer, or an Excel learner, understanding how to display formulas in Excel is important. This article will make you learn the simple steps to show the formulas of your Excel spreadsheets, enhancing your effic
4 min read
Top Excel Formulas and Functions You Should Know 2024
In the ever-evolving world of data analysis, mastering the top Excel formulas and functions is essential for maximizing productivity and efficiency. As we move into 2024, Excel remains a cornerstone tool for professionals across industries, from finance to marketing so for a better output you have to learn using Excel formulas. Whether you're a sea
15+ min read
How to Subtract in Excel - Easy Formulas
Learn how to subtract in Excel efficiently with this comprehensive guide. Discover essential Excel subtraction formulas, functions, and shortcuts to enhance your spreadsheet skills and streamline data management tasks. Whether you're handling financial data, calculating differences, or analyzing trends, mastering the Excel subtraction formula is a
10 min read
How to Calculate Standard Deviation in Excel: Quick Guide with Formulas and Examples
Understanding standard deviation in Excel is crucial for anyone looking to measure the spread or variability of a data set. Whether you're a student analyzing exam scores, a business professional evaluating sales data, or a researcher interpreting experimental results, knowing how to calculate standard deviation in Excel can provide valuable insigh
11 min read
How to Calculate Average in Excel: Essential Formulas & Examples for 2024
Whether you're a student crunching numbers for a project, a business analyst examining sales data, or simply someone looking to get insights from personal data, mastering the art of calculating averages in Excel can significantly enhance your data-handling capabilities. In this article, you will learn the basic average functions in Excel along with
8 min read
Editing Excel Macros in Excel
Excel Macro is a set of actions that can be recorded, saved, used multiple times. This feature saves us a lot of time when dealing with repetitive tasks and huge data sets. We can always make changes to an existing Macro in Excel. There are two ways to record and run macros: Excel Commands Excel Visual Basic for Applications(VBA).1. Copying a Macro
1 min read
How to Declare and Initialize String Array in Excel VBA?
A string array is an array where we can store only string values in the array, with the help of a string array, we can store more than one string value. We can declare the string array in many ways like declaring a static string array, declaring a variant size array of string using the Array function, and a string array using the split function whi
2 min read
Difference Between Array Formula and Regular Excel Formula
An array formula performs multiple calculations and processes multiple values at once, the array formula performs operations depending on the condition we have used with the array formula. Whereas the Regular excel formula performs operations on an individual value. Before understanding the difference between the two, let's first understand the def
4 min read
How to Remove Duplicates From Array Using VBA in Excel?
Excel VBA code to remove duplicates from a given range of cells. In the below data set we have given a list of 15 numbers in “Column A” range A1:A15. Need to remove duplicates and place unique numbers in column B. Sample Data: Cells A1:A15 Final Output: VBA Code to remove duplicates and place into next column (B) Declare Variables: VariablesData Ty
2 min read
How to Create an Array Formula in Excel?
Array formulas in excel are important tools. A single formula can perform multiple calculations and replace thousand of useful formulas. Most of us have never used array functions in our excel sheet just because we don't know how to use these formulas. Array formulas is one of the most confusing excel features to learn. The aim of this tutorial is
10 min read
How to Get Length of Array in Excel VBA?
We use UBound and LBound functions to get the length of an Array in Excel VBA. In this article, we will discuss them in detail. Syntax: UBound() function UBound (arrayname, [ dimension ]) Parameters: arrayname: required. Array variable namedimension: optional Returns: Return upper limit of an array dimension. Syntax: LBound() Function LBound (array
2 min read
How to Convert VBA Collections to Array in Excel?
An object that can store a number of values whether it can be of string data type or integer which can be easily manipulated or iterated is called Collection. On the other hand, Array is also used to store the data but it is multidimensional but collections are single dimensions. Now, we will see how to convert the collection to an array for that w
1 min read
Excel CHOOSE Function with Array
We often use the CHOOSE function in Excel to pick something from a list. In this article, we'll see how to use CHOOSE with a bunch of things (we call it an array) to do various stuff in Excel. This array can be either many cells we put into the function or many things we get from the function. What is CHOOSE Function with Array in ExcelThe Excel CH
5 min read
Scenario Manager in Excel
A Scenario Manager is a tool in Excel that works on a set of values that Excel saves and can be change up to 32 cells simultaneously. In this article, we will look at how we can use Scenario Manager in Excel. To do so follow the steps below: Step 1: Formatting data. Step 2: Highlight the data in which we want to change by Scenario Manager. Step 3:
1 min read
Excel VBA | count() functions
Visual Basic for Applications (VBA) is the programming language of Excel and other offices. It is an event-driven programming language from Microsoft. With Excel VBA one can automate many tasks in excel and all other office software. It helps in generating reports, preparing various charts, graphs and moreover, it performs calculation using its var
2 min read
How to Sum Diagonal Cells in a range in Excel?
The calculation of matrices is one of the most difficult numerical computation tasks. You may need to add values diagonally in a table when performing mathematical computations. Excel allows you to sum diagonal numbers without having to add the values one by one. We'll go through how to sum cells diagonally down or diagonally up. Example: The image
6 min read
How to Group Adjacent Columns or Rows Separately or Independently in Excel?
Excel comes with a range of tools and functions to work with complex spreadsheets easily. There are various options to organize content so that it makes more sense and lets one work effectively. Grouping adjacent rows and columns are one such feature that we can use to organize data effectively in Excel. But there is a catch. What if we want to mak
3 min read
Advanced Excel - Chart Design
The charts are the visual representation of data in both rows and columns. They are used to analyze the trends and patterns in the datasets. For example, If we want to analyze the sales of different courses for a specific period of time we can easily do this with the help of charts and get the result of queries such as months having a maximum numbe
4 min read
How to Use for Each Loop in Excel VBA?
A For Each loop is used to execute a statement or a set of statements for each element in an array or collection. Syntax: For Each element In group [ statements ] [ Exit For ] [ statements ] Next [ element ] The For...Each...Next statement syntax has the following three parts: PartDescriptionelement Required (Must be mentioned). Variable is used to
3 min read
How to Hide Zero Values in Excel
Microsoft Excel enables us to format, organize and calculate data in a spreadsheet. It's a great tool for preparing datasets and it makes those datasets easier for users and analysts to analyze the data. Sometimes these datasets contain zero values that are not required to be seen. Excel provides an easy way to hide those zero values without affect
6 min read
How to Create Dynamic Excel Dashboards Using Picklists?
Dashboards are a report technique that visually presents critical metrics or a data summary to allow for quick and effective business decisions. Excel is capable of handling complex statistical calculations, many of which are built-in as Functions and can be easily displayed on a dashboard. Excel dashboards allow for quick overviews of data reports
3 min read
Excel VBA | sum() functions
Visual Basic for Applications (VBA) is the programming language of Excel and other offices. It is an event-driven programming language from Microsoft. With Excel VBA one can automate many tasks in excel and all other office software. It helps in generating reports, preparing various charts, graphs and moreover, it performs calculation using its var
2 min read
Excel VBA | Average() Functions
VBA (Visual Basic for Applications) is the programming language of Excel and other offices. It is an event-driven programming language from Microsoft. With Excel VBA, one can automate many tasks in excel and all other office softwares. It helps in generating reports, preparing various charts, graphs and moreover, it performs calculation using its v
2 min read