DAY value between two dates

flashgordie

Board Regular
Joined
Jan 9, 2008
Messages
95
Office Version
  1. 365
Platform
  1. Windows
Hello, I am trying to establish a formula that will determine if the DAY value will fall between two dates.

A1 = Start Date; B1 = March 28-13 cell formatted as date
A2= End Date; B2 = April 8-13 cell formatted as date
A3= DAY; B3 = 01 cell formatted as date but to only display the DAY as dd


In this case the formula would determine whether or not B3 falls between B1 and B2. In this case it does, as the first of the month (01) does indeed fall between the 28th and the 8th.

I realize the is probably a disconnect in cell B3 formatted as a date, and the fact that it is only the DAY that I want to look at, but if I knew had to work that I , I wouldn't need your help. So with that said, any assistance would be greatly appreciated!

Thank you!
 
Last edited:

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
To check that a date B3 is between B1 and B2 you can use a formula like this

=AND(B3>=B1,B3<=B2)

....of course that will only be TRUE here if the date is actually 1st April 2013 (not any other 1st of the month)
 
Upvote 0
Thank for the reply, however, that is the problem, I am looking to use the DAY not the date. The date will change, but the day of the month will always be the first. So my problem is a formula that will use the DAY, Not the actual date
 
Upvote 0
OK, for your example, assuming that any day from 28 to 8 will result in TRUE try this formula

=(DAY(B1)<=DAY(B3))+(DAY(B2)>=DAY(B3))+(DAY(B2)<=DAY(B1))=2

That's not looking at the dates, just the days - I'm assuming that the B1/B2 date range is always a maximum of a month long

If that doesn't do what you want can you provide some more examples?
 
Upvote 0
Thanks BH, Thank you! Yes, your assumption of the date range being a maximum of a month long is correct. from a quick look, that looks more along the lines of what I am looking for. I transformed this into an "if" statement.

=IF(((DAY($F$3)<=DAY($H8))+(DAY($F$4)>=DAY($H8))+(DAY($F$4)<=DAY($F$3))=2),Data!E22,"---") ...but I still was wondering what the '=2' refers to, is that the true false condition? is this based on odd vs even for true and false?

Thanks for your help. I think I'm back on track now.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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