Lookup a date in a range challenge

hobson

New Member
Joined
May 30, 2012
Messages
4
Hi

I've run into a bit of a challenge with dates. Essentially I'm have a bi-monthly calendar with date ranges appearing every two months for a 12 month period.

I have two tabs, the first (tab A) contains all the date ranges and an entry for a specific date that doesn't correspond to the range (it shouldn't in this instance). For example, see the table below, B4 contains the date Sun-06-Jul currently in the range of B2.

ABCDEF
1JulyAugustSeptember
2
Sun-06-Jul

<tbody>
</tbody>
Sun-13-Jul

<tbody>
</tbody>
Sun-03-Aug

<tbody>
</tbody>
Sun-17-Aug

<tbody>
</tbody>
Sun-07-Sep

<tbody>
</tbody>
Sun-14-Sep

<tbody>
</tbody>
3
Mon-28-Jul

<tbody>
</tbody>
4
Sun-06-Jul

<tbody>
</tbody>
5
Sun-06-Jul

<tbody>
</tbody>
6
Sun-06-Jul

<tbody>
</tbody>

<tbody>
</tbody>


The aim is on a separate tab (tab B) to show the date within the range to which it corresponds. For example, if(And(B4>=A2, B4<b2) then="" show="" the="" date="" in="" cell="" <em="">A4.<b2,b4,"") <="" em=""> In words the Sun-06-Jul (B4) should appear in the range to which it corresponds based on the rule that it is greater or equal to the start of that range and less than the start of the next range.

I've tried several ways of solving this using lookups, if statements and can only think of a valid solution using a nested if function which for each cell (e.g. A4 checks if the date in A4 on tab A sits within the range, if not, then it looks if B4 sits within the range and so on). Obviously the problem here is that this explodes and apart from excel not allowing such a large function, it is a poor solution.

Any thoughts on this would be greatly appreciated. I've exhausted my abilities.

Thanks.</b2,b4,"")></b2)>
 

Excel Facts

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

In your example, there's only one date per row. Is this necessarily the case for the rest of the data?

Cheers,
Rukt
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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