View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
adhide adhide is offline
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.