Combine ranges with CHOOSE
Summary
To combine ranges or arrays horizontally, you can use the CHOOSE function with an array constant. In the example shown, the formula in cell G5 is:
The result is that the range B5:B16 and range D5:D16 are joined together horizontally into a single
range.
Generic formula
Explanation
In this example, the goal is to join two one-dimensional ranges together horizontally. This can be done with the CHOOSE function and array constant.
The CHOOSE function
The CHOOSE function is used to select arbitrary values by numeric position. CHOOSE is a flexible function and accepts a list of text values, numbers, cell references, in any combination. For example, if we have the colors "red", "blue", and "green", we can use CHOOSE like this:
If we give CHOOSE an array constant like {1,2}, CHOOSE will return the first and second values in an array at the same time:
The result is an array that contains two values and, in the dynamic array version of Excel, these values spill onto the worksheet into the range G5:H16.
ليست هناك تعليقات:
إرسال تعليق