I am working on spreadsheet that works with a school calendar. I have a sequence of dates that is a list of Wednesdays. I am trying to do a VLOOKUP on it to find out what type of day a specific date is. (Wednesdays are either Alt or Half days, all other days are Standard days) My intent was to use the VLOOKUP to find Alt or Half, and IFERROR to fill in Standard if the day is not a Wednesday (Not found in the range) For some reason, all days are matching. If the search key is not a Wednesday, the returned value is the previous Wednesday. Why is this happening? What can I do to solve it?
Here's a sample spreadsheet that demonstrates the problem:
https://docs.google.com/spreadsheets/d/1TWjMMk6t5bv0DwCG-qOSuwFYd9Yz9uoAEoOsqioHIMw/edit?usp=sharing
My formula is in cell G2
Best Answer
Finally figured this out. The issue is in the details of how a match is found based on the
[is_sorted]
parameter. I had it set toTRUE
, because the dates are sorted. However, "Ifis_sorted
isTRUE
or omitted, the nearest match (less than or equal to the search key) is returned." -https://support.google.com/docs/answer/3093318?hl=enSo the solution is to set
is_sorted
toFALSE
even though my range is sorted.