Match Day and Month Between two Dates (Without Year) from list of data

mba_110

Board Regular
Joined
Nov 28, 2012
Messages
80
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

I am trying to match day and month between two dates, as mentioned below these dates do not have years only Day and month.

for example

B C D
B3 = Start Date C3 = End Date D3= Query Date
14-Mar 15-Apr 13-Apr-1990
Format: (DD,MMM) (DD,MMM) (DD,MM,YYYY)

The date i am trying to match is full date with year value at D3 but the dates in C & D do not have year value.

I want if D3 Date's (Day and Month) fall between B & C's Day and month then it will be = E4 otherwise, "" blank

I hope its clear to understand.
 
Glad you got XL2BB working (y)

I couldn't see that it included the expected result though? .. or an answer to my question about the expected result?

BTW, best not to include long wordy instructions in the XL2BB sheet as it makes the display rather big and less easy to see the relevant part(s)
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Glad you got XL2BB working (y)

I couldn't see that it included the expected result though? .. or an answer to my question about the expected result?

BTW, best not to include long wordy instructions in the XL2BB sheet as it makes the display rather big and less easy to see the relevant part(s)
Formula is showing spill error if i drag this formula to cover all the rows for lookup, so i need to find the person name beside the Start and End dates as mentioned in the list, based on the search date. at D4 (Without Year), I want formula that should not have spill because there are two reasons one is we are going to do lot of work/calculations based on this result and below this cell there will be lot of content which cannot be change.

Excel Date Sample.xlsx
ABCDE
3
4Search Date19-Apr-90
5Sample Data
6
7
8Start DateEnd DateNames
921-Mar21-AprJohn Martin
1022-Apr20-MayLisa Morison
1121-May21-JunAhmed Ali
1222-Jun23-JulRajesh Kumar
1324-Jul23-AugMona Darling
1424-Aug23-SepMohan Kumar
1524-Sep23-OctJia Khan
1624-Oct22-NovRobert Anderson
1723-Nov22-DecJay Roy
1823-Dec20-JanAnjali Verma
1921-Jan19-FebMuskan Mirza
2020-Feb20-MarSuraj Agarwal
21
22Who is Available between these datesJohn Martin
23
Sheet1
Cell Formulas
RangeFormula
D22:D33D22=LET(b,TEXT(--B9:B20,"mdd"),c,TEXT(--C9:C20,"mdd"),d,TEXT(--$D$4,"mdd"),IF(MOD(c-b,1200)=MOD(c-d,1200)+MOD(d-b,1200),D9:D20,""))
Dynamic array formulas.
 
Last edited:
Upvote 0
@ mba_110: See if the following formula works for you:
Excel Formula:
=INDEX(D9:D20,MATCH(TRUE,LET(b,TEXT(--B9:B20,"mdd"),c,TEXT(--C9:C20,"mdd"),d,TEXT(--$D$4,"mdd"),MOD(c-b,1200)=MOD(c-d,1200)+MOD(d-b,1200)),0))
 
Upvote 0
@ mba_110: See if the following formula works for you:
Excel Formula:
=INDEX(D9:D20,MATCH(TRUE,LET(b,TEXT(--B9:B20,"mdd"),c,TEXT(--C9:C20,"mdd"),d,TEXT(--$D$4,"mdd"),MOD(c-b,1200)=MOD(c-d,1200)+MOD(d-b,1200)),0))
Thank you very much, formula is working perfect, people like you is always a sign of survival for others.
 
Upvote 0
@ Peter_SSs: Could you please examine your MEDIAN-based formula for a Dec-Jan pair?
Good point! I hadn't considered/tested that one. :oops:

However, it looks like I was on the wrong track anyway. Despite being repeatedly told that columns B & C do not have a year, and me specifically asking in post#4 if they were text values (no response), it appears from the XL2BB sample data in post #12 that columns B & C do have years (just formatted to hide them)

Given the changed circumstances, the MEDIAN idea could still be used as in column F below & I have used that column to retrieve the relevant name.

23 07 20.xlsm
BCDEF
4Search Date17-Jan-90
5
6
7
8Start DateEnd DateNames
921-Mar21-AprJohn MartinNo
1022-Apr20-MayLisa MorisonNo
1121-May21-JunAhmed AliNo
1222-Jun23-JulRajesh KumarNo
1324-Jul23-AugMona DarlingNo
1424-Aug23-SepMohan KumarNo
1524-Sep23-OctJia KhanNo
1624-Oct22-NovRobert AndersonNo
1723-Nov22-DecJay RoyNo
1823-Dec20-JanAnjali VermaYes
1921-Jan19-FebMuskan MirzaNo
2020-Feb20-MarSuraj AgarwalNo
21
22Anjali Verma
Dates2
Cell Formulas
RangeFormula
F9:F20F9=LET(d,--(TEXT(D$4,"dmmm")&YEAR(B$9)),IF(d=MEDIAN(d,EDATE(B9,-12*(MONTH(C9)=1)),C9),"Yes","No"))
D22D22=XLOOKUP("Yes",F9:F20,D9:D20)
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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