VLOOKUP against a date range and document name based on name and publication date of a book to return the version number of the book

ayeready

New Member
Joined
Oct 26, 2018
Messages
18
Hi all.

I'm having a problem trying to code this correctly and i'm looking for some assistance. I'm looking for a user to input a book title along with a date, in order to automatically show the correct version they should be using. For example:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Search Criteria[/TD]
[TD]Book[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]User Input[/TD]
[TD]Book1[/TD]
[TD]01/07/2018[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">

</code>This should then return a value of Book1 V2 based on the table below:

[TABLE="class: grid, width: 300"]
<tbody>[TR]
[TD]Book[/TD]
[TD]Start Date[/TD]
[TD]End Date[/TD]
[/TR]
[TR]
[TD]Book1 V1[/TD]
[TD]01/08/2016[/TD]
[TD]31/07/2017[/TD]
[/TR]
[TR]
[TD]Book1 V2[/TD]
[TD]01/08/2017[/TD]
[TD]31/07/2018[/TD]
[/TR]
[TR]
[TD]Book1 V3[/TD]
[TD]01/08/2018[/TD]
[TD]31/07/2019[/TD]
[/TR]
[TR]
[TD]Book2 V1[/TD]
[TD]01/08/2016[/TD]
[TD]31/07/2017[/TD]
[/TR]
[TR]
[TD]Book2 V2[/TD]
[TD]01/08/2017[/TD]
[TD]31/07/2018[/TD]
[/TR]
</tbody>[/TABLE]

<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">
</code>I've searched for the past 2 weeks and just cannot find the correct formula to get this to work properly.
One of the pitfalls of google learning rather than properly learning excel i'm afraid.
:(

Any help would be greatly appreciated as i'm banging my head against a brick wall just now.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I'd probably 'cheat'.

Name your search fields as S_BOOK & S_DATE, then in a column next to the table enter this formula and copy down :

=IF(AND(LEFT(A2,LEN(S_BOOK))=S_BOOK,B2<=S_DATE,C2>=S_DATE),"Yes","No")
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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