Forum Discussion
AlejandroRuben
Nov 26, 2018Copper Contributor
Test if day of month falls between two dates
I have a spreadsheet that projects cash flows by week. Each column represents "The week of [date]" where [date] is the Monday of a week. Each row is a bill, such as rent or a subscription, that is to...
- Nov 27, 2018
Like this?
=IF( (($B2>=DAY(C$1))+(EOMONTH(C$1,0)+$B2<(C$1+7)))*($B2<(DAY(C$1)+7))*($B2<=DAY(EOMONTH(C$1,0))), $A2,0)
AlejandroRuben
Nov 27, 2018Copper Contributor
We should use whichever week contains the due date. In the case of Feb 1, it should be the week of Jan 28 because the week of Jan 28 contains:
Jan 28 - Monday
Jan 29 - Tuesday
Jan 30 - Wednesday
Jan 31 - Thursday
Feb 1 - Friday
Feb 2 - Saturday
Feb 3 - Sunday
I am not concerned with weekends vs weekdays, but only which week the pay date falls into each month.
SergeiBaklan
Nov 27, 2018Diamond Contributor
Like this?
=IF( (($B2>=DAY(C$1))+(EOMONTH(C$1,0)+$B2<(C$1+7)))*($B2<(DAY(C$1)+7))*($B2<=DAY(EOMONTH(C$1,0))), $A2,0)
- AlejandroRubenNov 27, 2018Copper Contributor
Yes! That does what I want. Thank you so much!
- SergeiBaklanNov 27, 2018Diamond Contributor
You are welcome
- dwisemanJun 11, 2023Copper Contributor
SergeiBaklan I am trying to adapt this formula for weekly dates that are the end of the week as opposed the the beginning of the week. I'm having difficulty understanding the logical test here. I tried changing the <> signs and changing the +7 to -7, but that didn't work. Can you assist?