VLOOKUP Date Between in Google Sheets: Step-by-Step
In this article
To look up a value for a date that falls between two dates in Google Sheets, you cannot use VLOOKUP alone because it matches an exact value or the nearest smaller value, not a range with a lower and upper bound. The practical solution is to combine VLOOKUP with a helper column, or switch to INDEX and MATCH with a logical test. The helper-column method is the most reliable for most users: create a column that flags which date range each row belongs to, then use VLOOKUP on that flag. This guide walks through both approaches, explains what to do when dates are stored as text, and covers the mistakes that cause #N/A errors.
What You'll Need
- A Google Sheet with at least two tables: one containing the date you want to look up, and one containing date ranges (start date and end date) plus the value you want to return.
- Dates stored as real dates, not text. You can check by selecting a cell and looking at the alignment: real dates align right by default, text aligns left. If they are text, use Data > Split text to columns or the DATEVALUE function to convert them.
- Basic familiarity with cell references and the VLOOKUP syntax: VLOOKUP(search_key, range, index, [is_sorted]).
Step-by-Step
- Set up your date-range table. In a sheet (for example, Sheet2), enter columns for Start Date, End Date, and the value you want to return. For example: A2 = 1/1/2025, B2 = 1/31/2025, C2 = "January". Add one row per range. Make sure the ranges do not overlap and are sorted by start date ascending.
- Add a helper column to the lookup table. In column D of Sheet2, enter a formula that combines the start and end dates into a single text key. For example, in D2:
=A2&"-"&B2. This creates a key like "1/1/2025-1/31/2025". Copy down for all rows. This helper column is what VLOOKUP will search against. - In your main table, create the same helper key for the date you want to look up. Suppose your lookup date is in cell F2. In G2, enter a formula that finds which range contains that date. The simplest way is to use a formula that checks each range:
=IF(AND(F2>=Sheet2!A2, F2<=Sheet2!B2), Sheet2!D2, "")— but that only works for one row. Instead, use an array formula or a helper column in the main table that concatenates the date with itself? That does not work because the date is a single value, not a range. The correct approach is to use VLOOKUP with a sorted start-date column and an approximate match, then verify the end date. See step 4. - Use VLOOKUP with approximate match on the start date. In your main table, in the cell where you want the result, enter:
=VLOOKUP(F2, Sheet2!A2:C10, 3, TRUE). This finds the row where the start date is less than or equal to F2, and returns the value from column C. However, this does not check the end date. To ensure the date falls within the range, wrap it in an IF:=IF(F2<=VLOOKUP(F2, Sheet2!A2:B10, 2, TRUE), VLOOKUP(F2, Sheet2!A2:C10, 3, TRUE), "Not in range"). This checks that F2 is not after the end date of the matched row. If it is, it returns "Not in range". This works because the start dates are sorted ascending and the ranges are contiguous. - Alternative: use INDEX and MATCH with a logical test. If you prefer not to rely on sorting, use:
=INDEX(Sheet2!C2:C10, MATCH(1, (F2>=Sheet2!A2:A10)*(F2<=Sheet2!B2:B10), 0)). In Google Sheets, this may require wrapping in ARRAYFORMULA:=ARRAYFORMULA(INDEX(Sheet2!C2:C10, MATCH(1, (F2>=Sheet2!A2:A10)*(F2<=Sheet2!B2:B10), 0))). This returns the value from column C where the date falls between the start and end dates. If no match, it returns #N/A; wrap with IFERROR to handle that. - Test with sample dates. Enter a date that falls inside a range, one that falls outside, and one that is exactly on a boundary. Check that the formula returns the correct value or your error message. Adjust the range references to match your actual data size.
- Format the result column. If the returned value is a date, apply Format > Number > Date. If it is text, no formatting is needed.
Common Mistakes
- Dates stored as text. VLOOKUP and comparisons will fail or give wrong results. Convert text dates to real dates using DATEVALUE or by re-entering them in a recognized format.
- Unsorted start dates with approximate VLOOKUP. The approximate match (TRUE) requires the first column of the range to be sorted ascending. If not, results are unpredictable.
- Overlapping ranges. If two ranges both contain the same date, the formula may return the first match, which might not be the intended one. Ensure ranges do not overlap.
- Forgetting to lock ranges. When copying formulas down, use absolute references (e.g., Sheet2!$A$2:$C$10) so the lookup table does not shift.
- Using VLOOKUP with exact match (FALSE) on a date range. Exact match will only find an exact date, not a range, so it returns #N/A for dates inside a range but not equal to the start date.
Tips
- Use named ranges for your lookup table to make formulas easier to read and maintain.
- If you have many date ranges, consider using a Google Sheets query or filter instead of a single formula.
- Wrap your formula in IFERROR to display a friendly message like "Date not found" instead of #N/A.
- For dates that include times, ensure both the lookup date and range dates are either date-only or include times consistently. You can use INT() to strip the time portion.
- Test boundary dates: the start date and end date should be included in the range. Adjust your comparison operators (>= and <=) as needed.
Troubleshooting
If your formula returns #N/A, first check that the lookup date is a real date and that the range dates are real dates. Select a date cell and look at the formula bar: a real date shows as a date, text shows as text. Next, verify that the start dates in your lookup table are sorted ascending if using approximate VLOOKUP. If using INDEX/MATCH, ensure the arrays are the same size. If the formula returns the wrong value, check for overlapping ranges or a missing end-date check. If you see #VALUE!, a cell in the range may contain an error or text that cannot be compared. Use ISNUMBER to test each date cell. If the formula works for some rows but not others, check for stray spaces or non-printing characters in the date cells; use TRIM and CLEAN to remove them.
Frequently Asked Questions
Can VLOOKUP find a date between two dates without a helper column?
Not directly. VLOOKUP matches a single value. You need either a helper column that creates a unique key for each range, or you use INDEX and MATCH with a logical test that checks both bounds.
Why does my VLOOKUP return the wrong value for a date that is inside a range?
Because VLOOKUP with approximate match returns the value for the largest start date that is less than or equal to your lookup date. If your ranges are not contiguous or if the end date is not checked, it may return a value from a range that does not actually contain the date. Always add an end-date check.
How do I handle dates that include time stamps?
Use INT() to extract the date portion from both the lookup date and the range dates, or ensure all dates are entered as date-only values. Mixing date and datetime values can cause comparisons to fail.
What if my date ranges are not sorted?
Use the INDEX and MATCH array formula instead of VLOOKUP with approximate match. That method does not require sorting.
Can I use this with Google Sheets QUERY function?
Yes. You can use a QUERY like =QUERY(Sheet2!A:C, "SELECT C WHERE A <= date '"&TEXT(F2,"yyyy-mm-dd")&"' AND B >= date '"&TEXT(F2,"yyyy-mm-dd")&"'") to return the value. This is more advanced but avoids helper columns.
Why does my formula show #N/A even though the date looks correct?
The most common cause is that one of the dates is stored as text. Check the alignment and use DATEVALUE to convert. Also check for leading or trailing spaces.