Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default select date in date range

I want to be able to do the following:


A B
1 26/03/2006 $20.00
2 1/12/2006 $40.00
3 1/10/2007 $100.00
4
5
6
7 28/11/2006 2
8 29/11/2006 2

I need a formula that says if the date in A7 is between date in A1 to
A2, then muliply B7 by B1, else if the date in A7 is between date in
A2 to A3, then multiply B7 by B2, and so on.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default select date in date range

Assuming the dates in A1:A3 are in chrono order (as posted)
Put in C1: =IF(A2="",A1,A2)
Copy C1 down to C3

Then place this in C7's formula bar, press CTRL+SHIFT+ENTER (CSE) to confirm
the formula, instead of just pressing ENTER:
=IF(A7="","",INDEX($B$1:$B$3,MATCH(1,($A$1:$A$3<=A 7)*($C$1:$C$3=A7),0)))
Copy C7 down to return required results

Adapt the above to suit your actual extents
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
wrote in message
...
I want to be able to do the following:


A B
1 26/03/2006 $20.00
2 1/12/2006 $40.00
3 1/10/2007 $100.00
4
5
6
7 28/11/2006 2
8 29/11/2006 2

I need a formula that says if the date in A7 is between date in A1 to
A2, then muliply B7 by B1, else if the date in A7 is between date in
A2 to A3, then multiply B7 by B2, and so on.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default select date in date range

Just to add on a little more .. The formula suggested in C7 is essentially
an array formula which needs to be array-entered via CSE.

If you did the CSE confirmation correctly, you should see Excel wrap curly
braces: { } around the formula in the formula bar (ie in C7's formula bar).
If you don't see it (the curly braces), click inside the formula bar and try
the CSE confirmation again.

The visual check on the curly braces is the *only way* (afaik) to check that
the formula is correctly array-entered. If the formula is NOT array-entered,
of course it won't return correctly.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default select date in date range

=VLOOKUP(A7,$A$1:$B$3,2)*B7


" wrote:

I want to be able to do the following:


A B
1 26/03/2006 $20.00
2 1/12/2006 $40.00
3 1/10/2007 $100.00
4
5
6
7 28/11/2006 2
8 29/11/2006 2

I need a formula that says if the date in A7 is between date in A1 to
A2, then muliply B7 by B1, else if the date in A7 is between date in
A2 to A3, then multiply B7 by B2, and so on.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default select date in date range

Thanks, just trying to wrap my mind around the formula.

I need to mutiply the number in B7 with the date result returned in either
B1,B2,B3

IE

if A7 isbetween $A$1:$A$2
then B7*$B$1, else
if A7 isbetween $A$2:$A$3
then B7*$B$2 else
if A7 isbetween $A$3:NOW()
then A7*$B$3, else,""

I know these arent the Excel formula codes but my SQL gets in the way.

"Max" wrote:

Assuming the dates in A1:A3 are in chrono order (as posted)
Put in C1: =IF(A2="",A1,A2)
Copy C1 down to C3

Then place this in C7's formula bar, press CTRL+SHIFT+ENTER (CSE) to confirm
the formula, instead of just pressing ENTER:
=IF(A7="","",INDEX($B$1:$B$3,MATCH(1,($A$1:$A$3<=A 7)*($C$1:$C$3=A7),0)))
Copy C7 down to return required results

Adapt the above to suit your actual extents
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
wrote in message
...
I want to be able to do the following:


A B
1 26/03/2006 $20.00
2 1/12/2006 $40.00
3 1/10/2007 $100.00
4
5
6
7 28/11/2006 2
8 29/11/2006 2

I need a formula that says if the date in A7 is between date in A1 to
A2, then muliply B7 by B1, else if the date in A7 is between date in
A2 to A3, then multiply B7 by B2, and so on.






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default select date in date range

Or....I could use a simple vlookup table...thansk

"Teethless mama" wrote:

=VLOOKUP(A7,$A$1:$B$3,2)*B7


" wrote:

I want to be able to do the following:


A B
1 26/03/2006 $20.00
2 1/12/2006 $40.00
3 1/10/2007 $100.00
4
5
6
7 28/11/2006 2
8 29/11/2006 2

I need a formula that says if the date in A7 is between date in A1 to
A2, then muliply B7 by B1, else if the date in A7 is between date in
A2 to A3, then multiply B7 by B2, and so on.


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default select date in date range

Errata, formula in C7 should be:
=IF(A7="","",INDEX($B$1:$B$3,MATCH(1,($A$1:$A$3<=A 7)*($C$1:$C$3=A7),0)))*B7
(array-entered)

Forgot you wanted to multiply it by the value in B7

P/s: There's a subtle difference between TM's vlookup & the array above. If
you have repeated reference dates in A1 down, and the lookup date happens to
coincide with that ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default select date in date range

Wasn't sure if you were the original poster??
For info, I've posted a correction to the formula in C7
(yes, I forgot you wanted to multiply it by the value in B7)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


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
Sum select cells based on date range Chad Excel Worksheet Functions 2 March 4th 08 06:21 PM
Select data to appear on 2nd sheet by date range... Cbreze Excel Discussion (Misc queries) 0 June 28th 07 12:10 AM
Select a Range of column depending on the date Battykoda via OfficeKB.com Excel Worksheet Functions 1 May 2nd 07 08:22 PM
select date range in column garlocd Excel Worksheet Functions 2 July 11th 06 06:23 AM
date criteria to select range Kstalker Excel Worksheet Functions 30 August 23rd 05 07:19 AM


All times are GMT +1. The time now is 04:37 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"