Harry Lime
Harry Lime

Reputation: 89

(Excel) Lookup where lookup value isn't exactly in the array

Background: I usually do "full reviews" on select categories during months 5, 8, 9, and 12, where an excerpt of this schedule can be seen in the image below (F1:I13). For example, for category 101 I usually do a full review on months 5, 9, and 12 (as seen in cells F8:F10; Note that the values in column F are of the format [Category]-[Month]. E.g., Cell F2 is the lookup key for category 085 during December/12).

Example of normal process: If doing a full review on 5/2015 for category 101, I would input "5" and "2015" in cells B2:B3, then cells B5:B6 would properly VLOOKUP the first and second prior dates of full reviews for the category. So in this case,

B5.Value() = 12.2014

B6.Value() = 9.2014

Problem: I have begun a process where I intend on doing a partial review during all the months I don't do a full review for each category, but the process of pulling in the first and second prior full review dates would no longer work. For example, as seen below, if I want to do a partial review in 6/2015, I want to pull in "5.2015" and "12.2014" in cells B5:B6.

The issue I run into is that the array on the right-side is produced by an outside source and I can't really do anything to edit it (it's also MUCH larger than the excerpt I have shown and too many things depend on its current format; the array gets updated at the start of each year).

Is there a clever way to figure out how to lookup the proper prior full review dates during partial reviews, where the partial review dates aren't clearly defined in the first column of the lookup array (Lookup Key)?

enter image description here

Upvotes: 0

Views: 105

Answers (1)

itzmurd4
itzmurd4

Reputation: 663

=INDEX(H2:H13,MATCH("*"&B1&"-"&"*",G2:G13,0))

This should do the trick. Just create another row for specifically finding partial review dates.

enter image description here

Upvotes: 1

Related Questions