Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 80
Default Return a Value between dates based on another Value

Sample data:

ColA ColB ColC
Row1 22 1/16/2009 55
Row2 23 1/18/2009 17
Row3 22 1/20/2009 33
Row4 25 1/23/2009 9

I have several thousand rows with every column a named range, i.e. rng1,
rng2, etc.

Example: I want to return '55' and '33' from ColC, based on '22' from ColA
between the dates 1/1/2009 and 1/31/2009 (ColB).

Thx,
casey

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Return a Value between dates based on another Value

I have several thousand rows

Any formula solution for that many rows will be slow to calculate. Have you
considered using a filter?

--
Biff
Microsoft Excel MVP


"casey" wrote in message
...
Sample data:

ColA ColB ColC
Row1 22 1/16/2009 55
Row2 23 1/18/2009 17
Row3 22 1/20/2009 33
Row4 25 1/23/2009 9

I have several thousand rows with every column a named range, i.e. rng1,
rng2, etc.

Example: I want to return '55' and '33' from ColC, based on '22' from ColA
between the dates 1/1/2009 and 1/31/2009 (ColB).

Thx,
casey



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 80
Default Return a Value between dates based on another Value

I do use the filter for ad hoc analysis. However, I want to 'list' the
answer (plus many others) to another area for static charts using dynamic
data. The extra time is ok with me as I have many reports that run
weekly/monthly using this data already.

thx,
casey

"T. Valko" wrote:

I have several thousand rows


Any formula solution for that many rows will be slow to calculate. Have you
considered using a filter?

--
Biff
Microsoft Excel MVP


"casey" wrote in message
...
Sample data:

ColA ColB ColC
Row1 22 1/16/2009 55
Row2 23 1/18/2009 17
Row3 22 1/20/2009 33
Row4 25 1/23/2009 9

I have several thousand rows with every column a named range, i.e. rng1,
rng2, etc.

Example: I want to return '55' and '33' from ColC, based on '22' from ColA
between the dates 1/1/2009 and 1/31/2009 (ColB).

Thx,
casey




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Return a Value between dates based on another Value

Try this...

Data in the range A1:C4.

A1:A4 = named range Rng1
B1:B4 = named range Rng2
C1:C4 = named range Rng3

Enter these column headers:

E1 = Lookup
F1 = From
G1 = To
H1 = Total Records
I1 = Results

E2:G2 are pretty much self-explanatory.

E2 = lookup value 22
F2 = start date 1/1/2009
G2 = end date 1/31/2009

Enter this formula in H2. This will return the count of records that meet
the criteria:

=SUMPRODUCT(--(Rng1=E2),--(Rng2=F2),--(Rng2<=G2))

Enter this array formula** in I2. This will extract those records.

=IF(ROWS(I$2:I2)H$2,"",INDEX(Rng3,SMALL(IF((Rng1= E$2)*(Rng2=F$2)*(Rng2<=G$2),ROW(Rng3)),ROWS(I$2:I 2))-MIN(ROW(Rng3))+1))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

Copy the formula in I2 down until you get blanks meaning all records have
been extracted. Depending on how many rows you copy the array formula to,
this could take several seconds to calculate.

--
Biff
Microsoft Excel MVP


"casey" wrote in message
...
I do use the filter for ad hoc analysis. However, I want to 'list' the
answer (plus many others) to another area for static charts using dynamic
data. The extra time is ok with me as I have many reports that run
weekly/monthly using this data already.

thx,
casey

"T. Valko" wrote:

I have several thousand rows


Any formula solution for that many rows will be slow to calculate. Have
you
considered using a filter?

--
Biff
Microsoft Excel MVP


"casey" wrote in message
...
Sample data:

ColA ColB ColC
Row1 22 1/16/2009 55
Row2 23 1/18/2009 17
Row3 22 1/20/2009 33
Row4 25 1/23/2009 9

I have several thousand rows with every column a named range, i.e.
rng1,
rng2, etc.

Example: I want to return '55' and '33' from ColC, based on '22' from
ColA
between the dates 1/1/2009 and 1/31/2009 (ColB).

Thx,
casey






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
return value based on another value Steve Excel Discussion (Misc queries) 4 June 6th 09 06:32 PM
Return dates based on month and day of week lesg46 Excel Worksheet Functions 8 January 4th 07 12:47 AM
return based on range of dates Matt Excel Worksheet Functions 6 February 15th 06 08:36 PM
return value based upon another dziw Excel Worksheet Functions 4 September 26th 05 09:08 AM
return array result in cell based on comparing dates Ruthki Excel Worksheet Functions 7 June 30th 05 11:41 PM


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

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

About Us

"It's about Microsoft Excel"