ARGS2ARRAY


Uses the specified arguments to create an array

Syntax:

ARGS2ARRAY(arguments)

arguments can be either a range, or multiple arguments separated by commas.


Example:

If A1:A10 contains numbers 1 to 10:

ARGS2ARRAY(A1:A10)

returns [1,2,3,4,5,6,7,8,9,10]


If A1 contains 1 and A2 contains 2:

ARGS2ARRAY(A1, A2)

returns [1,2]


B1 contains ARGS2ARRAY(A1:A10) and B2 contains ARGS2ARRAY(A1, A2)

A

B

1
1
[1,2,3,4,5,6,7,8,9,10]
2
2
[1,2]
3
3
 
4
4
 
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
10
 

Application:

A Data Entry Clerk


Imagine you are a manager and you have a new data entry clerk. This clerk's job is to process a list of sales transactions. Each transaction is a row on a spreadsheet, and the format is always the same: Product ID, Product Name, and then a series of quarterly sales numbers.


The Sales Spreadsheet:

Product ID

Product Name

Q1 Sales

Q2 Sales

Q3 Sales

Q4 Sales

A
B
C
D
E
F
1
P001
Laptop
$12,000.00
$15,500.00
$14,200.00
$18,100.00
2
P002
Smartphone
$8,500.00
$9,200.00
$10,500.00
$9,800.00
3
P003
Tablet
$6,200.00
$5,800.00
$6,700.00
$7,100.00
4
P004
Monitor
$4,500.00
$5,100.00
$4,900.00
$5,500.00

The Clerk's Function:


You give the clerk a specific task for each product: "Calculate the total annual sales, and find the highest and lowest quarterly sales."


Instead of giving the clerk a complicated set of instructions like: "Look at column C, then column D, then column E, then column F, and add them all up," you give them a simpler, more powerful instruction that acts like ARGS2ARRAY:


"For each row, take the group of all the sales numbers, and put them in a temporary list."


  • The command: ARGS2ARRAY(temporary_sales_list, Quarter 1 Sales, Quarter 2 Sales, Quarter 3 Sales, Quarter 4 Sales)


  • Clerk's actions for the "Laptop" row:
    1. The clerk reads the sales numbers: 12000, 15500, 14200, 18100.
    2. They follow your instruction, ARGS2ARRAY, which means they mentally create a temporary list: [12000, 15500, 14200, 18100].


  • The calculation: Now that all the sales numbers are in one list, the clerk can easily perform the required tasks with simple, repetitive steps:


    • To get the total: They just add up every number in the temporary_sales_list.
    • To find the highest: They scan through the temporary_sales_list and pick out the largest number.
    • To find the lowest: They scan through the temporary_sales_list and pick out the smallest number.



Why this is an ARGS2ARRAY analogy:


This scenario perfectly illustrates the function's purpose. It takes a series of individual, discrete items (the "arguments" like Quarter 1 Sales, Quarter 2 Sales, etc.) and automatically organizes them into a single, cohesive collection (the "array" or temporary_sales_list). This makes the subsequent processing (calculating the total, min, and max) much more straightforward and less dependent on knowing the exact number of sales columns. If you add Quarter 5 Sales, you only need to update the ARGS2ARRAY command, not the entire calculation process.




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