Return dates from a list based on Month and Year cells

rhaas128

Board Regular
Joined
Jul 5, 2013
Messages
84
I have a workbook that has a defined list of months and years, along with a 2 different date columns that are not currently named. I need to be able to put a month/year on sheet1 from dropdown lists, and have the corresponding dates populate from those 2 different columns. Below is a sample idea of what I currently have:

Main table:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Month(Dropdown)[/TD]
[TD]Year(Dropdown)[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Datecol1[/TD]
[TD]Datecol2[/TD]
[/TR]
</tbody>[/TABLE]

Date column table:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Datecol1[/TD]
[TD]Datecol2[/TD]
[/TR]
[TR]
[TD]07/20/2018[/TD]
[TD]07/27/2018[/TD]
[/TR]
[TR]
[TD]08/03/2018[/TD]
[TD]08/10/2018[/TD]
[/TR]
[TR]
[TD]08/17/2018[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


So if I choose 'August' and '2018' from the main table, it would return results like this:

[TABLE="width: 500"]
<tbody>[TR]
[TD]August[/TD]
[TD]2018[/TD]
[/TR]
[TR]
[TD]08/03/2018[/TD]
[TD]08/10/2018[/TD]
[/TR]
[TR]
[TD]08/17/2018[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Can someone help me achieve this? Hopefully my goal makes sense. Thanks for all help in advance!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi,

Take a look if this helps:


Book1
ABC
1Main table:
2
3Month(Dropdown)Year(Dropdown)
482018
5
6
7Date column table:
8Datecol1Datecol2
920-7-201827-7-2018
103-8-201810-8-2018
1117-8-2018
12
13Selector
14MonthYear
1582018
16Result
17Datecol1Datecol2
183-8-201810-8-2018
1917-8-2018
Sheet1
Cell Formulas
RangeFormula
A18{=IFERROR(INDEX($A$8:$A$11, MATCH(0, COUNTIF(A17:$A$17, $A$8:$A$11)+IF(MONTH($A$8:$A$11)<>$A$15, 1, 0)+IF(YEAR($A$8:$A$11)<>$B$15, 1, 0), 0),1), "")}
C18{=IFERROR(INDEX($C$8:$C$11, MATCH(0, COUNTIF(C17:$C$17, $C$8:$C$11)+IF(MONTH($C$8:$C$11)<>$A$15, 1, 0)+IF(YEAR($C$8:$C$11)<>$B$15, 1, 0), 0),1), "")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,248
Members
452,623
Latest member
cliftonhandyman

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