05 Array Functions
05 Array Functions
Key takeaways:
1 Array Functions
- FILTER Function
- UNIQUE Function
- SORT Function
- SORTBY Function
- CHOOSECOLS Function
- SEQUENCE Function
- GROUPBY Function
- PIVOTBY Function
- TEXTJOIN Function
- TEXTSPLIT Function
- LAMBDA Function
2 Use Cases
- Unique values with criteria
- SORT and SORTBY with multiple columns
- FILTER data based on multiple criteria
Quick Notes:
=UNIQUE(array,by_col,exactly_once)
Returns a list of unique values in a list or range. Values can be text, numbers, dates, times, etc.
Arguments
array - Range or array from which to extract unique values.
by_col - [optional] How to compare and extract. By row = FALSE (default); by column = TRUE.
exactly_once - [optional] TRUE = values that occur once, FALSE= all unique values (default).
Quick Notes:
=FILTER(array,include,if_empty)
Filters a range of data based on supplied criteria, and extracts matching records.
Arguments
array - Range or array to filter.
include - Boolean array, supplied as criteria.
if_empty - [optional] Value to return when no results are returned.
o worksheet as a range
State Qty
Filter the data where State is Maharashtra AND quantity is greater than and equal to 40
Case 1: extract specific columns from a dataset or range in Excel without manually rearranging or deleting data.
Case 2: Dynamically extract specific columns from a dataset or range in Excel without hardcoding column number or mann
Case 3: Dynamically extract specific columns from a dataset or range in Excel without hardcoding column number or mann
Series = EQ
Quick Notes:
=SORT(array,sort_index,sort_order,by_col)
By default, the SORT function will sort values in ascending order using the first column.
End result is an dynamic array of 'sorted' values.
If the array is end result i.e not nefted to another function, array values gets 'splilled' onto worksheet as a range
that gets updated automatically when values are added or removed to the source range
Qty Company Code Name of the Company
250
500
290
400
180
140
490
180
540
340
220
320
220
270
340
440
670
220
550
380
470
200
510
170
160
400
230
330
840
260
400
420
370
ending order.
o worksheet as a range
State Qty
Sort the below data - by State and followed by Name of the Company in ascending orde
Quick Notes:
=SORT(array,sort_index,sort_order,by_col)
By default, the SORT function will sort values in ascending order using the first column.
End result is an dynamic array of 'sorted' values.
If the array is end result i.e not nefted to another function, array values gets 'splilled' onto worksheet as a range
that gets updated automatically when values are added or removed to the source range
mpany in ascending order
ending order.
o worksheet as a range
State Qty
Sort the below data - by State and followed by Name of the Company in ascending orde
Quick Notes:
=SORTBY(array,by_array,sort_order,...)
Sorts the content of range or array in a specified order based on the values from another range or array.
Arguments
array - Range or array to sort.
by_array - Range or array to sort by.
sort_order - [optional] Sort order. 1 = ascending (default), -1 = descending.
array/order - [optional] Additional array and sort order pairs.
mpany in ascending order
range or array.
State Qty
NSE - Capital Market Data
Month Mar/2022 Mar/2023 Mar/2024 Dec/2024 YoY 2024 vs 2023 YoY 2025 vs 2024
No of Companies listed As at Year end
No. of Companies available for trading As at Year end
No. of securities traded As at Year end
No. of trades (in Lakhs) Aggregation
Traded Quantity
Aggregation
(in Lakhs)
Turnover
Aggregation
(₹ Crores)
Market Capitalisation (₹ Crores) As at Year end
End
Adding Row and Column Totals
1,119,143,097
Generate a list of sequential numbers
<> END <>
Quick Notes: