dsGetRange


The dsGetRange is a special spreadsheet function supplied by Deriscope that takes as input a text identifying some range plus optional shift parameters and returns the contents of that range.

Visit the
Deriscope Excel Functions for practical tips on how to generate demos of this and the other Deriscope functions on the spreadsheet.
The input text may refer to a named range and even to a range residing in another workbook, as the Example 2 below shows.
The ability to return the contents of ranges residing in external workbooks makes this function very useful for passing data among workbooks without having external links and without using the volatile native INDIRECT function.

Example 1
=dsGetRange( "A1:B2" )
Note that entering =dsGetRange( A1:B2 ) would fail since the argument A1:B2 is not enclosed in double quotes and therefore is not regarded as text.

Example 2
=dsGetRange( "Book1.xlsx!SomeName" )
where SomeName is the name - with workbook scope - of a named range residing in the external workbook Book1.xlsx.
This formula works provided the workbook Book1.xlsx is open.

The function also accepts 4 optional parameters in the below order:

offsetRows
Optional integer (default = 0) that defines the number of rows by which the top/left cell of the source range should be shifted downwards.

offsetCols
Optional integer (default = 0) that defines the number of columns by which the top/left cell of the source range should be shifted to the right.

finalHeight
Optional integer (default = 0) that defines the height, i.e. the number of rows of the final range. A non-positive number means the final range has the same height as the source range.

finalWidth
Optional integer (default = 0) that defines the width, i.e. the number of columns of the final range. A non-positive number means the final range has the same width as the source range.