CHOOSEROWS

Formulas / CHOOSEROWS
Return specific rows from an array or range.
=CHOOSEROWS(array, row_num1, [row_num2], ...)
  • array - required argument
  • row_num1 - required argument which specifies which rows to return
  • row_num2, row_num3, ... - [OPTIONAL] argument which specifies which additional rows to return

Examples

  • =CHOOSEROWS(A1:A5,1,3)

    This returns the first and third rows of the A1:A5 range. This is because the function takes two arguments: the range and two row numbers. The function will then return the two rows specified in the arguments.

  • =CHOOSEROWS(A1:A5,3,1)

    This example returns rows 3 and 1 from A1:A5. This is because the function takes two arguments: the range and two row numbers. It will return the two rows specified.

  • =CHOOSEROWS(A1:A5,6)

    The formula returns a #VALUE! error because it takes a row number that is out of range. Since the range A1:A5 only has 5 rows, the function cannot return a sixth row.

  • =CHOOSEROWS(B3:F9,{1,4,7})

    The example uses an array constant to get rows 1, 4, and 7 from B3:F9. An array constant is a set of values in curly brackets, { }. The function will take the range and array as arguments, and return the specified rows.

Summary

The CHOOSEROWS function enables users to select and return specified rows from an array, creating a new array with the selected rows.

  • The CHOOSEROWS function takes an array and a row number as arguments and returns a new array.
  • The row numbers must be within the bounds of the array, or a #VALUE! error will be thrown.


Frequently Asked Questions

What is the CHOOSEROWS function?
The CHOOSEROWS function is a Sourcetable function that returns the specified rows from an array.
What is the first argument of the CHOOSEROWS function?
The first argument of the CHOOSEROWS function is array.
Is the array argument required for the CHOOSEROWS function?
Yes, the array argument is required for the CHOOSEROWS function.
Are additional row numbers arguments optional for the CHOOSEROWS function?
Yes, the additional row numbers arguments are optional for the CHOOSEROWS function.
What error does Sourcetable return if any of the row_num arguments are zero or greater than the number of rows in the array?
Sourcetable returns an error if any of the row_num arguments are zero or greater than the number of rows in the array.
Sourcetable Logo

Work smarter

Al is here to help. Leverage the latest models to
analyze spreadsheets, enrich data, and create reports.

Drop CSV