Help with Excel formula checking if date is within date range.

9tanstaafl9

Well-known Member
Joined
Mar 23, 2008
Messages
535
I'm sure there is probably an easy way to do this, but I can't wrap my head around it.

Say the beginning date in E4 = 2/2/14, the ending date in F4 = 4/5/14. I have columns headings listing the beginning and ending dates of each month, where L1 = 1/1/14 and L2 = 1/31/14, M1 = 2/1/14 etc.

I need a formula that will return the value of column K if any date in the range falls within the month above. So in this example, for row 4, the value would display in Feb (col M), March (col N) and April (col O).

How would I do that?

Right now I have this:
Code:
=IF(AND([@strdte]>=L$1,[@strdte]<=L$2)=TRUE,[@Value],0)

But that only gives me the starting month.

Any help appreciated. I am normally fairly smart but this is just stumping me.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
NEVERMIND. I found the answer while I was waiting for a reply. It seems I wanted to search for a formula to find if two date ranges overlap or not. I found it not on this website so I'm not sure if it's kosher to post the link or not.

<code>I tried to post the formula but it keeps getting chopped off. Not sure what is going on.

<code><a,b<x),"do not="" overlap","overlap")<="" strong=""></a,b<x),"do></code>
</code><code></code>
 
Last edited:
Upvote 0
You confused me. Try adding a table to help explain this.
E
F
K
LMN
O
1
Begin
End
1/1/2014
2/1/2014
2
1/31/2014
3
4
2/2/2014
4/5/2014

<tbody>
</tbody>
That's all i could piece together from your explanation.
 
Upvote 0
I'm so sorry for confusing you and even more for finding the answer while you were trying to help me. Thank you for taking the time to map out my badly worded question. You did get it right. So if K4 was 1000 I would want 1000 to appear in M4, N4 and O4.

Anyway, I found something that worked. It keeps getting truncated when I try to post however. Basically it started like this = if(OR(<l$1,l$2<[@strdte]),0,[@value])
<l$1,l$2<[@strdte]),0,[@value])

<l$1,l$2<[@strdte]),0,[@value])[ quote]
Thanks again!



You confused me. Try adding a table to help explain this.
E
F
K
LMN
O
1
BeginEnd1/1/20142/1/2014
2
1/31/2014
3
4
2/2/20144/5/2014

<tbody>
</tbody>
That's all i could piece together from your explanation.
</l$1,l$2<[@strdte]),0,[@value])[></l$1,l$2<[@strdte]),0,[@value])
</l$1,l$2<[@strdte]),0,[@value])>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top