Return values from data set B based on range of dates in data set A

Marklarbear

Board Regular
Joined
Nov 6, 2003
Messages
112
Office Version
  1. 365
Platform
  1. Windows
HI all - Im using Microsoft Office 365 ProPlus.

I have 2 data sets (set A & set B). In set A i have a date range - start of range in cells E & end of date range in cells F. In data set B, I have a range of dates of special days (E26:E100) with date description in column F (F26:F100). What I need to do is in data set A in column G, is to return any special days that fall within the range along with its applicable date (as in the screen shot G12 needs to return 3 special days of data into the cell, where as G11 only has 1 special day).

Data set A will only ever have 13 cycles in it - however the dates will change from year to year. Data set B can have multiple years of data in it. some of those days will repeat (ie Mothers Day), however the date themselves will be unique to that year.

Any help with a formula to go into cells G7 to G19 in set A would be greatly appreciated....

Capture A.PNG
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Im using Microsoft Office 365 ProPlus.
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using.

Also suggest posting sample data with XL2BB as helpers generally are not interested in typing it. ;)

See if this does what you want.

20 02 28.xlsm
EFG
715/01/2021 
812/02/2021 
912/03/2021 
109/04/2021Special 1 (03/05)
117/05/2021Special 2 (09/05)
124/06/2021Special 3 (07/06), Special 4 (14/06), Special 5 (28/06)
132/07/2021 
1430/07/2021Special 6 (02/08), Special 7 (11/08)
15.
16
17
18
19
20
21
22
23
24
25
263/05/2021Special 1
279/05/2021Special 2
287/06/2021Special 3
2914/06/2021Special 4
3028/06/2021Special 5
312/08/2021Special 6
3211/08/2021Special 7
Special Days
Cell Formulas
RangeFormula
G7:G14G7=TEXTJOIN(", ",TRUE,IF(LOOKUP(E$26:E$32,E$7:E$14)=E7,F$26:F$32 & TEXT(E$26:E$32," (dd/mm)"),""))
 
Upvote 0
Thankyou for replying .... and the advise to use XL2BB ;)

I have tried your formula but i seem to be doing something wrong..... The below is the range where im placing the formula:

Cell Formulas
RangeFormula
C28C28=Inputs!B6
D28:D40D28=C28+27
E28:E40E28=TEXTJOIN(", ",TRUE,IF(LOOKUP('Special Days'!$D$2:$D$100,$C$28:$C$40)=C28,'Special Days'!$E$2:$E$100 & TEXT('Special Days'!$D$2:$D$100," (dd/mm)"),""))
C29:C40C29=D28+1



The range where im placing the special days is on another tab:

WBC SBG Rec Allocations - build.xlsx
DE
1DateSpecial Day
21/01/2020New Years Day
326/01/2020Australia Day (National)
427/01/2020Australia Day (National)
526/02/2020Launceston Cup Day
62/03/2020Labour Day (WA)
79/03/2020Canberra Day(ACT), Labour Day (VIC) ,Eight Hour Day (TAS) ,Adelaide Cup Day (SA)
810/04/2020Good Friday(National)
911/04/2020Easter Saturday (Local - as WA or Tasmania not declaring it)
1012/04/2020Easter Sunday
1113/04/2020Easter Monday (National)
1214/04/2020Easter Tuesday Tas only
1325/04/2020Anzac Day(National)
1427/04/2020Anzac Day PH WA only
154/05/2020QLD Labour Day
1610/05/2020Mother’s Day – 2nd Sunday in May
171/06/2020Western Australia Day (WA)
188/06/2020Queen's Birthday (NSW ACT VIC TAS SA NT QLD)
1930/06/2020EOFY - where applicable review last week of June to 2nd week of July.
203/08/2020NSW Bank Holiday
2112/08/2020QLD Show Day
2228/08/2020Gold Coast Show Day
236/09/2020Father’s Day – 1st Sunday in September
2425/09/2020VIC - AFL Grand Final Friday
2526/09/2020AFL Grand Final – Last Saturday in September
2628/09/2020Queens Birthday (WA)
274/10/2020NRL Grand Final – First Sunday in October
285/10/2020Labour Day(NSW ACT QLD SA)
298/10/2020Royal Launceston Show Day (TAS)
3011/10/2020Bathurst (car race) – Second Sunday in October
312/11/2020Recreation Day
323/11/2020Melb Cup day
3325/12/2020Christmas Day(National)
3426/12/2020Boxing Day (National)
351/01/2021New Years Day
3626/01/2021Australia Day (National)
3724/02/2021Launceston Cup Day
381/03/2021Labour Day (WA)
398/03/2021Canberra Day(ACT), Labour Day (VIC) ,Eight Hour Day (TAS) ,Adelaide Cup Day (SA)
402/04/2021Good Friday(National)
413/04/2021Easter Saturday (Local - as WA or Tasmania not declaring it)
424/04/2021Easter Sunday
435/04/2021Easter Monday (National)
446/04/2021Easter Tuesday Tas only
4525/04/2021Anzac Day(National)
4626/04/2021Anzac Day PH WA only
473/05/2021QLD Labour Day
489/05/2021Mother’s Day – 2nd Sunday in May
497/06/2021Western Australia Day (WA)
5014/06/2021Queen's Birthday (NSW ACT VIC TAS SA NT QLD)
5128/06/2021EOFY - where applicable review last week of June to 2nd week of July.
522/08/2021NSW Bank Holiday
5311/08/2021QLD Show Day
5427/08/2021Gold Coast Show Day
555/09/2021Father’s Day – 1st Sunday in September
5624/09/2021VIC - AFL Grand Final Friday
5725/09/2021AFL Grand Final – Last Saturday in September
5827/09/2021Queens Birthday (WA)
593/10/2021NRL Grand Final – First Sunday in October
604/10/2021Labour Day(NSW ACT QLD SA)
617/10/2021Royal Launceston Show Day (TAS)
6210/10/2021Bathurst (car race) – Second Sunday in October
631/11/2021Recreation Day
642/11/2021Melb Cup day
6525/12/2021Christmas Day(National)
6626/12/2021Boxing Day (National)
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Special Days



I seem to get #N/A .... not sure where im going wrong? (on the special days tab ive gone down to row 100 to allow for any additional special events to be included if needed in the future)
 
Upvote 0
I have tried your formula but i seem to be doing something wrong..
The problem is that in your original sample data, no dates in the 'Special' range (E26:E32) were before the first date in your 'main' range (E7).
In you latest data there are dates in the 'Special' range before the first date in your 'main' range.

Try this instead.

Marklarbear 2020-03-10 1.xlsm
BCDE
27Cycle NOCycle StartCycle Stop
28115/01/202111/02/2021Australia Day (National) (26/01)
29212/02/202111/03/2021Launceston Cup Day (24/02), Labour Day (WA) (01/03), Canberra Day(ACT), Labour Day (VIC) ,Eight Hour Day (TAS) ,Adelaide Cup Day (SA) (08/03)
30312/03/20218/04/2021Good Friday(National) (02/04), Easter Saturday (Local - as WA or Tasmania not declaring it) (03/04), Easter Sunday (04/04), Easter Monday (National) (05/04), Easter Tuesday Tas only (06/04)
3149/04/20216/05/2021Anzac Day(National) (25/04), Anzac Day PH WA only (26/04), QLD Labour Day (03/05)
3257/05/20213/06/2021Mother’s Day – 2nd Sunday in May (09/05)
3364/06/20211/07/2021Western Australia Day (WA) (07/06), Queen's Birthday (NSW ACT VIC TAS SA NT QLD) (14/06), EOFY - where applicable review last week of June to 2nd week of July. (28/06)
3472/07/202129/07/2021 
35830/07/202126/08/2021NSW Bank Holiday (02/08), QLD Show Day (11/08)
36927/08/202123/09/2021Gold Coast Show Day (27/08), Father’s Day – 1st Sunday in September (05/09)
371024/09/202121/10/2021VIC - AFL Grand Final Friday (24/09), AFL Grand Final – Last Saturday in September (25/09), Queens Birthday (WA) (27/09), NRL Grand Final – First Sunday in October (03/10), Labour Day(NSW ACT QLD SA) (04/10), Royal Launceston Show Day (TAS) (07/10), Bathurst (car race) – Second Sunday in October (10/10)
381122/10/202118/11/2021Recreation Day (01/11), Melb Cup day (02/11)
391219/11/202116/12/2021 
401317/12/202113/01/2022Christmas Day(National) (25/12), Boxing Day (National) (26/12)
SBG Summary (2)
Cell Formulas
RangeFormula
D28:D40D28=C28+27
E28:E40E28=TEXTJOIN(", ",TRUE,IF(IFERROR(LOOKUP('Special Days'!D$2:D$100,C28:C40)=C28,),'Special Days'!$E$2:$E$100 & TEXT('Special Days'!$D$2:$D$100," (dd/mm)"),""))
C29:C40C29=D28+1
 
Upvote 0

Forum statistics

Threads
1,215,575
Messages
6,125,628
Members
449,240
Latest member
lynnfromHGT

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