ARRAYLENGTH


Returns the length of an array

Syntax:

ARRAYLENGTH(array)


array is the array of values we are looking at.


Example:

If A1:A10 contains numbers 1 to 10:

ARRAYLENGTH(A1:A10)

returns 10



A

B

1
1
10
2
2
 
3
3
 
4
4
 
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
10
 

Application:

An excellent application of the ARRAYLENGTH function can be found in data analysis or spreadsheet software. Imagine you are managing the inventory for a small bookstore. You have a spreadsheet to track the books in stock, including their titles, authors, and the list of genres associated with each book. The genres are stored as an array (or list) since a single book can belong to multiple genres (e.g., "Mystery," "Thriller," and "Crime Fiction").


Here is a simplified table representing your inventory data:

Book Title

Product Name

Tags

A
B
C
1
The Astral Loom
Elara Vance

["Sci-Fi", "Fantasy"]

2
Whispers of the Chronos
Kaelen Reed

["Time Travel", "Mystery", "Adventure"]

3
The Glimmering Citadel
Lyra Sterling

["Epic Fantasy", "Quest"]

4
A Single Dawn
Jace Thorne

["Post-Apocalyptic"]

5
The Quantum Conundrum
Silas Blackwood

["Sci-Fi", "Hard Sci-Fi", "Thriller"]


Now, let's use the ARRAYLENGTH function to find out how many genres are assigned to each book. We'll add a new column called "Number of Genres" and apply the function to the "Genres" column for each book.


Applying the ARRAYLENGTH function to each row would give us the following:

Book Title

Product Name

Tags

Number of Genres

A
B
C
D
1
The Astral Loom
Elara Vance

["Sci-Fi", "Fantasy"]

2
2
Whispers of the Chronos
Kaelen Reed

["Time Travel", "Mystery", "Adventure"]

3
3
The Glimmering Citadel
Lyra Sterling

["Epic Fantasy", "Quest"]

2
4
A Single Dawn
Jace Thorne

["Post-Apocalyptic"]

1
5
The Quantum Conundrum
Silas Blackwood

["Sci-Fi", "Hard Sci-Fi", "Thriller"]

3



This page is protected by Google reCAPTCHA. Privacy - Terms.
 
Built using Zapof