GETARRAYELEMENT


Returns the element found in an array based on a index given

Syntax:

GETARRAYELEMENT(array, index)


array is the array of values we are looking at.


index is the location of the element you are looking at in the array.


Example:

If A1:A10 contains numbers 1 to 10 and index is 5:

GETARRAYELEMENT(A1:A10, 5)

returns 5



A

B

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

Application:

Imagine a small online bookstore that needs to display the authors of a book. Some books have multiple authors, so the database stores them as a list (an array) of names. The GETARRAYELEMENT function can be used to retrieve a specific author from this list.


Book Authors Table

Book ID

Book Title

Authors

A
B
C
1
101
The Crystal Labyrinth
["A.B. Stone"]
2
102
The Chronicles of Eldoria
["Elias Thorne"]
3
103
Whispers in the Gloomwood
["Kaelen Blackwood", "Lyra Vance"]
4
104
The Skyfire Key
["Cassandra Brooks"]

Example Usage:


The bookstore's website needs to display the second author for the book "Whispers in the Gloomwood."


  • Function: GETARRAYELEMENT(Authors, 2)
  • Table Reference: The "Authors" column for Book ID 103.
  • Result: The function would return the element at the second index of the array ["Kaelen Blackwood", "Lyra Vance"], which is "Lyra Vance".


This function is useful because it allows the system to access a specific piece of data within a structured list without having to process the entire list, making the operation more efficient.

Result:

Lyra Vance



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