![]() |
|
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
making single array from non-contiguous ranges
The TTEST() function in Excel takes an array for its first argument.
The problem is that the array of data I need to enter is not contiguous. For example, the values I need are in A2:A15 and A30:A40. Is there some quick and easy way to combine non-contiguous ranges into a single array? Something like: TTEST({A2:A15,A30:A40}, B2:B40, 2, 2) The simple solution is to move the two ranges together, but that will cause other problems for me. If need be, we can go into what those problems are, but first I wanted to see if there was an easier solution. Could a Simple UDF be written? In a form like: TTEST(MAKE_ARRAY(A2:A15, A30:A40), B2:B40, 2, 2) Thanks! |
|
|||
|
Re: making single array from non-contiguous ranges
How about this
Function JoinArrays(rng1, rng2) As Variant JoinArrays = Union(rng1, rng2) End Function -- __________________________________ HTH Bob "Stonie J" <young.blake@gmail.com> wrote in message news:5533a0fb-2deb-41a6-92df-9644da4a752f@x36g2000prg.googlegroups.com... > The TTEST() function in Excel takes an array for its first argument. > The problem is that the array of data I need to enter is not > contiguous. For example, the values I need are in A2:A15 and A30:A40. > Is there some quick and easy way to combine non-contiguous ranges into > a single array? Something like: > > TTEST({A2:A15,A30:A40}, B2:B40, 2, 2) > > The simple solution is to move the two ranges together, but that will > cause other problems for me. If need be, we can go into what those > problems are, but first I wanted to see if there was an easier > solution. Could a Simple UDF be written? In a form like: > > TTEST(MAKE_ARRAY(A2:A15, A30:A40), B2:B40, 2, 2) > > Thanks! |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|