Maggie Barr
Board Regular
- Joined
- Jan 28, 2014
- Messages
- 188
Thank you in advance if you can help.
I started a new thread because I couldn’t edit my previous thread and I wanted to refine my request better.
I found an old post here on the forum that is very much like my issue:
https://www.mrexcel.com/forum/excel...ng-multiple-values-one-date-within-range.html
However, I am unable to modify the formula to my circumstances.
In sheet 1 I have four columns, Column A is a species; code, Column B is a date range, column C is the start date, and column D is the end date. In sheet 2 I have three columns, column A I have a species; code, in Column B I have a specific date, and in column C I have an observation number. I need to match Column A from both sheets and if the specific date in Column B in sheet 2 is outside the start and end dates in sheet one, have it return the observation numbers from sheet 2. I will likely have multiple matches, so I have solved this in the past with a MYVLOOKUP so it will return multiple values in one cell; however, I have never had to match things with a date range. If anyone can assist with this I would greatly appreciate it.
Thank you,
Maggie
Sample data below:
Sheet 1:
[TABLE="width: 0"]
<tbody>[TR]
[TD]Combined for Search
[/TD]
[TD]Safe Date Range
[/TD]
[TD]Start Date
[/TD]
[TD]End Date
[/TD]
[/TR]
[TR]
[TD]Species 1; S
[/TD]
[TD]1/25 - 8/1
[/TD]
[TD]25-Jan
[/TD]
[TD]1-Aug
[/TD]
[/TR]
[TR]
[TD]Species 1; H
[/TD]
[TD]1/25 - 8/1
[/TD]
[TD]25-Jan
[/TD]
[TD]1-Aug
[/TD]
[/TR]
[TR]
[TD]Species 1; S7
[/TD]
[TD]1/25 - 8/1
[/TD]
[TD]25-Jan
[/TD]
[TD]1-Aug
[/TD]
[/TR]
[TR]
[TD]Species 1; M
[/TD]
[TD]1/25 - 8/1
[/TD]
[TD]25-Jan
[/TD]
[TD]1-Aug
[/TD]
[/TR]
[TR]
[TD]Species 1; P
[/TD]
[TD]1/25 - 8/1
[/TD]
[TD]25-Jan
[/TD]
[TD]1-Aug
[/TD]
[/TR]
[TR]
[TD]Species 1; T
[/TD]
[TD]1/25 - 8/1
[/TD]
[TD]25-Jan
[/TD]
[TD]1-Aug
[/TD]
[/TR]
[TR]
[TD]Species 2; S
[/TD]
[TD]3/1 - 7/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[/TD]
[TD]3/1 - 11/1
[/TD]
[TD]1-Mar
[/TD]
[TD]1-Nov
[/TD]
[/TR]
[TR]
[TD]Species 4; S7
[/TD]
[TD]3/1 - 11/1
[/TD]
[TD]1-Mar
[/TD]
[TD]1-Nov
[/TD]
[/TR]
[TR]
[TD]Species 4; M
[/TD]
[TD]3/1 - 11/1
[/TD]
[TD]1-Mar
[/TD]
[TD]1-Nov
[/TD]
[/TR]
[TR]
[TD]Species 4; P
[/TD]
[TD]3/1 - 11/1
[/TD]
[TD]1-Mar
[/TD]
[TD]1-Nov
[/TD]
[/TR]
[TR]
[TD]Species 4; T
[/TD]
[TD]3/1 - 11/1
[/TD]
[TD]1-Mar
[/TD]
[TD]1-Nov
[/TD]
[/TR]
[TR]
[TD]Species 5; S
[/TD]
[TD]3/15 - 7/25
[/TD]
[TD]15-Mar
[/TD]
[TD]25-Jul
[/TD]
[/TR]
[TR]
[TD]Species 5; H
[/TD]
[TD]3/15 - 7/25
[/TD]
[TD]15-Mar
[/TD]
[TD]25-Jul
[/TD]
[/TR]
[TR]
[TD]Species 5; S7
[/TD]
[TD]3/15 - 7/25
[/TD]
[TD]15-Mar
[/TD]
[TD]25-Jul
[/TD]
[/TR]
[TR]
[TD]Species 5; M
[/TD]
[TD]3/15 - 7/25
[/TD]
[TD]15-Mar
[/TD]
[TD]25-Jul
[/TD]
[/TR]
[TR]
[TD]Species 5; P
[/TD]
[TD]3/15 - 7/25
[/TD]
[TD]15-Mar
[/TD]
[TD]25-Jul
[/TD]
[/TR]
[TR]
[TD]Species 5; T
[/TD]
[TD]3/15 - 7/25
[/TD]
[TD]15-Mar
[/TD]
[TD]25-Jul
[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2:
[TABLE="width: 0"]
<tbody>[TR]
[TD]Combined Name and Code
[/TD]
[TD]Month/Day
[/TD]
[TD]JUST OBS #
[/TD]
[/TR]
[TR]
[TD]Species 1; P
[/TD]
[TD]7/2
[/TD]
[TD]OBS515846307
[/TD]
[/TR]
[TR]
[TD]Species 2; S
[/TD]
[TD]7/16
[/TD]
[TD]OBS519564671
[/TD]
[/TR]
[TR]
[TD]Species 3; S
[/TD]
[TD]6/24
[/TD]
[TD]OBS513701323
[/TD]
[/TR]
[TR]
[TD]Species 4; S
[/TD]
[TD]6/28
[/TD]
[TD]OBS515074851
[/TD]
[/TR]
[TR]
[TD]Species 5; C
[/TD]
[TD]7/7
[/TD]
[TD]OBS516895128
[/TD]
[/TR]
[TR]
[TD]Species 6; C
[/TD]
[TD]7/20
[/TD]
[TD]OBS520017414
[/TD]
[/TR]
[TR]
[TD]Species 7; C
[/TD]
[TD]6/12
[/TD]
[TD]OBS510580788
[/TD]
[/TR]
[TR]
[TD]Species 8; C
[/TD]
[TD]6/20
[/TD]
[TD]OBS512629275
[/TD]
[/TR]
[TR]
[TD]Species 9; C
[/TD]
[TD]6/15
[/TD]
[TD]OBS511300253
[/TD]
[/TR]
[TR]
[TD]Species 10; S
[/TD]
[TD]7/24
[/TD]
[TD]OBS521005417
[/TD]
[/TR]
[TR]
[TD]Species 11; S
[/TD]
[TD]6/22
[/TD]
[TD]OBS513142107
[/TD]
[/TR]
[TR]
[TD]Species 12; H
[/TD]
[TD]6/8
[/TD]
[TD]OBS509643634
[/TD]
[/TR]
[TR]
[TD]Species 13; S
[/TD]
[TD]7/11
[/TD]
[TD]OBS518064152
[/TD]
[/TR]
[TR]
[TD]Species 14; M
[/TD]
[TD]7/21
[/TD]
[TD]OBS521093944
[/TD]
[/TR]
[TR]
[TD]Species 15; H
[/TD]
[TD]6/8
[/TD]
[TD]OBS509643633
[/TD]
[/TR]
[TR]
[TD]Species 16; H
[/TD]
[TD]6/8
[/TD]
[TD]OBS509641766
[/TD]
[/TR]
[TR]
[TD]Species 17; H
[/TD]
[TD]6/12
[/TD]
[TD]OBS510580786
[/TD]
[/TR]
[TR]
[TD]Species 18; H
[/TD]
[TD]6/20
[/TD]
[TD]OBS512629266
[/TD]
[/TR]
[TR]
[TD]Species 19; S
[/TD]
[TD]7/5
[/TD]
[TD]OBS516527783
[/TD]
[/TR]
[TR]
[TD]Species 20; S
[/TD]
[TD]7/24
[/TD]
[TD]OBS521005422
[/TD]
[/TR]
[TR]
[TD]Species 21; NY
[/TD]
[TD]6/11
[/TD]
[TD]OBS512920757
[/TD]
[/TR]
[TR]
[TD]Species 22; H
[/TD]
[TD]6/10
[/TD]
[TD]OBS511548393
[/TD]
[/TR]
[TR]
[TD]Species 23; F
[/TD]
[TD]7/24
[/TD]
[TD]OBS521005427
[/TD]
[/TR]
[TR]
[TD]Species 24; FY
[/TD]
[TD]7/8
[/TD]
[TD]OBS517081913
[/TD]
[/TR]
[TR]
[TD]Species 25; S
[/TD]
[TD]7/25
[/TD]
[TD]OBS521781854
[/TD]
[/TR]
[TR]
[TD]Species 26; S
[/TD]
[TD]7/27
[/TD]
[TD]OBS521484264
[/TD]
[/TR]
</tbody>[/TABLE]
I started a new thread because I couldn’t edit my previous thread and I wanted to refine my request better.
I found an old post here on the forum that is very much like my issue:
https://www.mrexcel.com/forum/excel...ng-multiple-values-one-date-within-range.html
However, I am unable to modify the formula to my circumstances.
In sheet 1 I have four columns, Column A is a species; code, Column B is a date range, column C is the start date, and column D is the end date. In sheet 2 I have three columns, column A I have a species; code, in Column B I have a specific date, and in column C I have an observation number. I need to match Column A from both sheets and if the specific date in Column B in sheet 2 is outside the start and end dates in sheet one, have it return the observation numbers from sheet 2. I will likely have multiple matches, so I have solved this in the past with a MYVLOOKUP so it will return multiple values in one cell; however, I have never had to match things with a date range. If anyone can assist with this I would greatly appreciate it.
Thank you,
Maggie
Sample data below:
Sheet 1:
[TABLE="width: 0"]
<tbody>[TR]
[TD]Combined for Search
[/TD]
[TD]Safe Date Range
[/TD]
[TD]Start Date
[/TD]
[TD]End Date
[/TD]
[/TR]
[TR]
[TD]Species 1; S
[/TD]
[TD]1/25 - 8/1
[/TD]
[TD]25-Jan
[/TD]
[TD]1-Aug
[/TD]
[/TR]
[TR]
[TD]Species 1; H
[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
[TR]
[TD]Species 3; S7
[/TD]
[TD]3/1 - 8/25
[/TD]
[TD]1-Mar
[/TD]
[TD]25-Aug
[/TD]
[/TR]
[TR]
[TD]Species 3; M
[/TD]
[TD]3/1 - 8/25
[/TD]
[TD]1-Mar
[/TD]
[TD]25-Aug
[/TD]
[/TR]
[TR]
[TD]Species 3; P
[/TD]
[TD]3/1 - 8/25
[/TD]
[TD]1-Mar
[/TD]
[TD]25-Aug
[/TD]
[/TR]
[TR]
[TD]Species 3; T
[/TD]
[TD]3/1 - 8/25
[/TD]
[TD]1-Mar
[/TD]
[TD]25-Aug
[/TD]
[/TR]
[TR]
[TD]Species 4; S
[/TD]
[TD]3/1 - 11/1
[/TD]
[TD]1-Mar
[/TD]
[TD]1-Nov
[/TD]
[/TR]
[TR]
[TD]Species 4; H
[/TD]
[TD]3/1 - 11/1
[/TD]
[TD]1-Mar
[/TD]
[TD]1-Nov
[/TD]
[/TR]
[TR]
[TD]Species 4; S7
[/TD]
[TD]3/1 - 11/1
[/TD]
[TD]1-Mar
[/TD]
[TD]1-Nov
[/TD]
[/TR]
[TR]
[TD]Species 4; M
[/TD]
[TD]3/1 - 11/1
[/TD]
[TD]1-Mar
[/TD]
[TD]1-Nov
[/TD]
[/TR]
[TR]
[TD]Species 4; P
[/TD]
[TD]3/1 - 11/1
[/TD]
[TD]1-Mar
[/TD]
[TD]1-Nov
[/TD]
[/TR]
[TR]
[TD]Species 4; T
[/TD]
[TD]3/1 - 11/1
[/TD]
[TD]1-Mar
[/TD]
[TD]1-Nov
[/TD]
[/TR]
[TR]
[TD]Species 5; S
[/TD]
[TD]3/15 - 7/25
[/TD]
[TD]15-Mar
[/TD]
[TD]25-Jul
[/TD]
[/TR]
[TR]
[TD]Species 5; H
[/TD]
[TD]3/15 - 7/25
[/TD]
[TD]15-Mar
[/TD]
[TD]25-Jul
[/TD]
[/TR]
[TR]
[TD]Species 5; S7
[/TD]
[TD]3/15 - 7/25
[/TD]
[TD]15-Mar
[/TD]
[TD]25-Jul
[/TD]
[/TR]
[TR]
[TD]Species 5; M
[/TD]
[TD]3/15 - 7/25
[/TD]
[TD]15-Mar
[/TD]
[TD]25-Jul
[/TD]
[/TR]
[TR]
[TD]Species 5; P
[/TD]
[TD]3/15 - 7/25
[/TD]
[TD]15-Mar
[/TD]
[TD]25-Jul
[/TD]
[/TR]
[TR]
[TD]Species 5; T
[/TD]
[TD]3/15 - 7/25
[/TD]
[TD]15-Mar
[/TD]
[TD]25-Jul
[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2:
[TABLE="width: 0"]
<tbody>[TR]
[TD]Combined Name and Code
[/TD]
[TD]Month/Day
[/TD]
[TD]JUST OBS #
[/TD]
[/TR]
[TR]
[TD]Species 1; P
[/TD]
[TD]7/2
[/TD]
[TD]OBS515846307
[/TD]
[/TR]
[TR]
[TD]Species 2; S
[/TD]
[TD]7/16
[/TD]
[TD]OBS519564671
[/TD]
[/TR]
[TR]
[TD]Species 3; S
[/TD]
[TD]6/24
[/TD]
[TD]OBS513701323
[/TD]
[/TR]
[TR]
[TD]Species 4; S
[/TD]
[TD]6/28
[/TD]
[TD]OBS515074851
[/TD]
[/TR]
[TR]
[TD]Species 5; C
[/TD]
[TD]7/7
[/TD]
[TD]OBS516895128
[/TD]
[/TR]
[TR]
[TD]Species 6; C
[/TD]
[TD]7/20
[/TD]
[TD]OBS520017414
[/TD]
[/TR]
[TR]
[TD]Species 7; C
[/TD]
[TD]6/12
[/TD]
[TD]OBS510580788
[/TD]
[/TR]
[TR]
[TD]Species 8; C
[/TD]
[TD]6/20
[/TD]
[TD]OBS512629275
[/TD]
[/TR]
[TR]
[TD]Species 9; C
[/TD]
[TD]6/15
[/TD]
[TD]OBS511300253
[/TD]
[/TR]
[TR]
[TD]Species 10; S
[/TD]
[TD]7/24
[/TD]
[TD]OBS521005417
[/TD]
[/TR]
[TR]
[TD]Species 11; S
[/TD]
[TD]6/22
[/TD]
[TD]OBS513142107
[/TD]
[/TR]
[TR]
[TD]Species 12; H
[/TD]
[TD]6/8
[/TD]
[TD]OBS509643634
[/TD]
[/TR]
[TR]
[TD]Species 13; S
[/TD]
[TD]7/11
[/TD]
[TD]OBS518064152
[/TD]
[/TR]
[TR]
[TD]Species 14; M
[/TD]
[TD]7/21
[/TD]
[TD]OBS521093944
[/TD]
[/TR]
[TR]
[TD]Species 15; H
[/TD]
[TD]6/8
[/TD]
[TD]OBS509643633
[/TD]
[/TR]
[TR]
[TD]Species 16; H
[/TD]
[TD]6/8
[/TD]
[TD]OBS509641766
[/TD]
[/TR]
[TR]
[TD]Species 17; H
[/TD]
[TD]6/12
[/TD]
[TD]OBS510580786
[/TD]
[/TR]
[TR]
[TD]Species 18; H
[/TD]
[TD]6/20
[/TD]
[TD]OBS512629266
[/TD]
[/TR]
[TR]
[TD]Species 19; S
[/TD]
[TD]7/5
[/TD]
[TD]OBS516527783
[/TD]
[/TR]
[TR]
[TD]Species 20; S
[/TD]
[TD]7/24
[/TD]
[TD]OBS521005422
[/TD]
[/TR]
[TR]
[TD]Species 21; NY
[/TD]
[TD]6/11
[/TD]
[TD]OBS512920757
[/TD]
[/TR]
[TR]
[TD]Species 22; H
[/TD]
[TD]6/10
[/TD]
[TD]OBS511548393
[/TD]
[/TR]
[TR]
[TD]Species 23; F
[/TD]
[TD]7/24
[/TD]
[TD]OBS521005427
[/TD]
[/TR]
[TR]
[TD]Species 24; FY
[/TD]
[TD]7/8
[/TD]
[TD]OBS517081913
[/TD]
[/TR]
[TR]
[TD]Species 25; S
[/TD]
[TD]7/25
[/TD]
[TD]OBS521781854
[/TD]
[/TR]
[TR]
[TD]Species 26; S
[/TD]
[TD]7/27
[/TD]
[TD]OBS521484264
[/TD]
[/TR]
</tbody>[/TABLE]