Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Partition data range by an indicator variable

The formula =OFFSET(Data!$R$1,1,0,COUNTA(Data!$R:$R)-1) returns the array of
data in column R. As I add data points, the size of the array changes to
match all of the data entered.

I would like to subset the data range into non-overlaping ranges by using an
indicator variable (1, 2, ...) in a different column.

Thanks,

Arne
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Partition data range by an indicator variable

Arne,

I think this is what you want. It assumes you are looking for the indicator
variable 1 on column A:

=INDEX(Sheet1!$A:$A,MATCH(1,Sheet1!$A:$A,-1)):OFFSET(INDEX(Sheet1!$A:$A,MATCH(1,Sheet1!$A:$A ,-1)),COUNTIF(Sheet1!$A:$A,1)-1,0)

hth,

Doug

"Arne" wrote in message
...
The formula =OFFSET(Data!$R$1,1,0,COUNTA(Data!$R:$R)-1) returns the array
of
data in column R. As I add data points, the size of the array changes to
match all of the data entered.

I would like to subset the data range into non-overlaping ranges by using
an
indicator variable (1, 2, ...) in a different column.

Thanks,

Arne



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Partition data range by an indicator variable

Doug,

I couldn't get the formula you suggested to work, but realized that I was
interpreting the syntax to match incorrectly. The expressions I came up with
we

=IF(ISNA(MATCH(1,Data!$B:$B)),OFFSET(Col_Date,1,0, COUNTA(Data!$A:$A)-1),OFFSET(Col_Date,1,0,MATCH(1,Data!$B:$B)-1))


=IF(ISNA(MATCH(2,Data!$B:$B,0)),IF(ISNA(MATCH(1,Da ta!$B:$B,0)),#N/A,OFFSET(Col_Date,MATCH(1,Data!$B:$B,0),0,COUNTA(D ata!$A:$A)-MATCH(1,Data!$B:$B,0))),OFFSET(Col_Date,MATCH(1,Da ta!$B:$B,0),0,MATCH(2,Data!$B:$B)-MATCH(1,Data!$B:$B)))


=IF(ISNA(MATCH(2,Data!$B:$B,0)),#N/A,OFFSET(Col_Date,MATCH(2,Data!$B:$B,0),0,COUNTA(D ata!$A:$A)-MATCH(2,Data!$B:$B,0)))


This returns arrays of the date stored in column A, where Col_Date is the
location of the column header. The indicator variable is in column B. The
possible indicator variables are none, 1, 2. This yields a maximum of three
partitions.

Thanks,

Arne

"Doug Glancy" wrote:

Arne,

I think this is what you want. It assumes you are looking for the indicator
variable 1 on column A:

=INDEX(Sheet1!$A:$A,MATCH(1,Sheet1!$A:$A,-1)):OFFSET(INDEX(Sheet1!$A:$A,MATCH(1,Sheet1!$A:$A ,-1)),COUNTIF(Sheet1!$A:$A,1)-1,0)

hth,

Doug

"Arne" wrote in message
...
The formula =OFFSET(Data!$R$1,1,0,COUNTA(Data!$R:$R)-1) returns the array
of
data in column R. As I add data points, the size of the array changes to
match all of the data entered.

I would like to subset the data range into non-overlaping ranges by using
an
indicator variable (1, 2, ...) in a different column.

Thanks,

Arne




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Partition + Grouping Longshot Excel Programming 3 April 2nd 07 03:40 PM
access partition function [email protected] Excel Worksheet Functions 3 February 5th 07 01:38 PM
Range of data is variable... Tom Mackay Charts and Charting in Excel 4 September 26th 06 11:16 PM
Set Data Range by Variable MJSlattery Excel Discussion (Misc queries) 4 June 10th 05 07:48 AM
how to format ntfs partition Zubair Alam Charts and Charting in Excel 0 April 29th 05 10:12 PM


All times are GMT +1. The time now is 06:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"