ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Lookups
  3. How to Look Up a Value by Date in Excel

How to Look Up a Value by Date in Excel

By ExcelReady Team·Updated November 1, 2026·6 min read

The short answer

To look up by date, treat the date like any other lookup value: =XLOOKUP(D2,A2:A6,B2:B6) finds an exact date. To get the value in effect on a date, such as a price that changed over time, use an approximate match: =XLOOKUP(D2,A2:A6,B2:B6,,-1) or =VLOOKUP(D2,A2:B6,2,TRUE). Both need real dates, not text.

Key takeaways

  • Excel stores dates as numbers, so date lookups work like number lookups.
  • Use an exact match to find a specific date, and match mode -1 (or VLOOKUP TRUE) for the value in effect on a date.
  • Build lookup dates with DATE(year,month,day) instead of typing text like "15/03/2024" into a formula.
  • Dates stored as text, or dates with a hidden time, are the main reasons a date lookup returns #N/A.
On this page+
  1. How Excel stores dates
  2. Find an exact date with XLOOKUP or VLOOKUP
  3. Find the value in effect on a date
  4. What happens before the first date
  5. Why a date lookup returns #N/A
  6. Look up by month, or by date and another value
  7. Practise it

A lookup by date in Excel works just like a lookup by ID or name, because Excel stores every date as a number. You can find an exact date with XLOOKUP or VLOOKUP, or find the value that was in effect on a date, such as the price on the day of an order. This guide shows both, and fixes the two problems that break most date lookups: text dates and hidden times.

How Excel stores dates#

Every date in Excel is a whole number: the count of days since 1 January 1900. So 15 March 2024 is stored as 45366, and the cell's format just shows it as a date. That is why you can subtract dates, sort them and look them up like numbers.

Two things follow from this:

  • A date lookup only works if both sides are real dates (numbers). Text that looks like a date is not a number.
  • A date with a time is a number with a decimal. 15 March 2024 at 6pm is 45366.75, which is not equal to 45366.

The date basics lesson explains date serial numbers in more detail.

Find an exact date with XLOOKUP or VLOOKUP#

To find the value for one specific date, use an exact match, as with any other lookup. Say a daily sales log has dates in A2:A8 and sales in B2:B8, with the date to find in D2:

Excel formula
=XLOOKUP(D2,A2:A8,B2:B8,"No sales logged")

If the date is there, you get that day's sales. If not, you get the message. In older versions, use VLOOKUP with FALSE:

Excel formula
=VLOOKUP(D2,A2:B8,2,FALSE)

To put a fixed date inside the formula, use the DATE function rather than text: =XLOOKUP(DATE(2024,3,15),A2:A8,B2:B8). DATE takes the year, month and day in that order, so it works the same in every region. A typed text date like "15/03/2024" depends on your computer's regional settings.

Find the value in effect on a date#

Often the date you have isn't in the table, because the table lists changes. A price list, an exchange rate table or a salary history only records the day each value started. You want the most recent change on or before your date.

AB
1Effective fromPrice
21 Jan 20244.50
31 Mar 20244.75
415 Jun 20244.90
51 Sep 20245.10
61 Jan 20255.25

An order on 20 July 2024 should use the price that started on 15 June: 4.90. With the order date in D2:

Excel formula
=XLOOKUP(D2,A2:A6,B2:B6,,-1)

Match mode -1 means "exact match, or the next smaller value". 20 July isn't in the list, so XLOOKUP takes the latest earlier date, 15 June, and returns 4.90. An order on exactly 1 September returns 5.10, because an exact match wins.

The VLOOKUP version uses TRUE for an approximate match:

Excel formula
=VLOOKUP(D2,A2:B6,2,TRUE)

It gives the same 4.90, but only if the dates are sorted oldest to newest. XLOOKUP doesn't need sorting. This is exactly the same method as a bracket lookup, with dates instead of income limits; see tax bracket and tier lookups for the full pattern.

What happens before the first date#

If the order date is earlier than every date in the table, there is no "next smaller" date, so both formulas return #N/A. An order on 10 December 2023 has no price in this list.

Add a message as XLOOKUP's fourth argument to make this clear:

Excel formula
=XLOOKUP(D2,A2:A6,B2:B6,"Before price list",-1)

Or add an earlier first row to the table if the first price applied before that date too.

Why a date lookup returns #N/A#

When a date you can see in the table returns #N/A, one side is not what it looks like. Check these:

ProblemHow to spot itFix
Dates stored as text=ISNUMBER(A2) returns FALSE; dates sit on the left of the cellConvert with DATEVALUE or Data > Text to Columns
Hidden timesFormat the cell as General and see a decimal, like 45366.75Look up INT(D2), or add a column with =INT(A2)
Lookup value typed as textThe formula has "15/03/2024" in quotesUse DATE(2024,3,15) instead
Wrong date orderDay and month are swapped after an importRebuild the date with DATE, LEFT, MID and RIGHT

Times sneak in from timestamps and system exports. For an exact-date lookup on timestamped data, use match mode -1 against a list of dates, or strip the times with INT first.

Look up by month, or by date and another value#

To match by month instead of a full date, compare the first day of each month. Put the first day of the month in a helper column with =EOMONTH(A2,-1)+1, then look up EOMONTH(D2,-1)+1 in that column with an exact match.

If the lookup also depends on something else, such as a product and a date, you need two conditions. The guide to lookups with multiple criteria shows how. To find the most recent entry for a name, read how to look up the last match. If the value you need sits to the left of the date column, see lookups to the left. And to add up values between two dates rather than find one, use SUMIFS with a date range.

For full syntax, see the XLOOKUP function guide and the VLOOKUP function guide.

Practise it#

Date lookups combine two skills: match modes and real dates. Practise XLOOKUP match modes in a live spreadsheet: you type the formula and it checks the result instantly. Then practise date basics so you can spot a text date or a hidden time before it breaks your lookup.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Prices change on the dates in column A. What price applied to the order dated 20 July 2024 in D2? In E2, use XLOOKUP with match mode -1 (exact date or the next earlier one).

fx
ABCDEF
1
Effective from
Price
Order date
Price
2
45292
4.5
45493
3
45352
4.75
4
45458
4.9
5
45536
5.1
6
45658
5.25
7
8
9

Tip: Look up D2 in A2:A6, return B2:B6, then leave the fourth argument empty and use -1.

Practise this in a lesson

LessonXLOOKUP wildcards and match modesSearch partial names with XLOOKUP's wildcard mode, and place values into tiers with next-smaller and next-larger matches.LessonHow Excel stores dates: DATE, YEAR, MONTH, DAYLearn why every date is secretly a number, then build dates with DATE and take them apart with YEAR, MONTH and DAY.Function guideXLOOKUPXLOOKUP explained with real examples: exact matches, looking left and custom not-found messages, plus a live exercise to try now.Function guideVLOOKUPLearn VLOOKUP with clear examples, the 4 most common mistakes, and a live practice exercise you can try in your browser.

Frequently asked questions

How do I do a VLOOKUP by date in Excel?

+

Use the date cell as the lookup value: =VLOOKUP(D2,A2:B6,2,FALSE) for an exact date. For the value in effect on a date, sort the dates ascending and use TRUE instead of FALSE.

Why does my date lookup return #N/A?

+

The dates probably don't match exactly. One side may be text that looks like a date, or include a time. Check with ISNUMBER and use INT to remove times.

How do I find the price on a given date?

+

List each price with the date it started, then use =XLOOKUP(D2,A2:A6,B2:B6,,-1). It returns the price from the latest start date on or before D2.

How do I put a date inside a lookup formula?

+

Use the DATE function: =XLOOKUP(DATE(2024,7,20),A2:A6,B2:B6,,-1). Typing the date as text in quotes depends on your regional settings and can fail.

Sources

  • XLOOKUP function - Microsoft Support
  • VLOOKUP function - Microsoft Support
  • DATE function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. How Excel stores dates
  2. Find an exact date with XLOOKUP or VLOOKUP
  3. Find the value in effect on a date
  4. What happens before the first date
  5. Why a date lookup returns #N/A
  6. Look up by month, or by date and another value
  7. Practise it

Keep reading

Lookups· 6 min read

Tax Bracket and Tier Lookups in Excel

For a tax bracket lookup, list each bracket's lower limit in ascending order with its rate, then use an approximate match: =VLOOKUP(B2,D2:E5,2,TRUE) or =XLOOKUP(B2,D2:D5,E2:E5,,-1). Both return the rate for the bracket the income falls in. To calculate progressive tax, add a base-tax column and use base + (income - lower limit) x rate.

Lookups· 7 min read

Find the Last Match in Excel With XLOOKUP

To find the last match, set XLOOKUP's sixth argument, search_mode, to -1 so it searches from the bottom up: =XLOOKUP(F2,A2:A8,C2:C8,"Not found",0,-1). It returns the value from the last row where column A equals F2, such as the most recent price in a list sorted oldest first. XLOOKUP needs Excel 2021 or Microsoft 365.

Lookups· 6 min read

Lookup With Multiple Criteria in Excel

To look up a value that must match two or more criteria, multiply the tests and look up 1: =XLOOKUP(1,(A2:A8=F2)*(B2:B8=F3),C2:C8). Each test gives 1 for TRUE and 0 for FALSE, so only rows that pass every test become 1. In Excel 2019 and earlier, use =INDEX(C2:C8,MATCH(1,(A2:A8=F2)*(B2:B8=F3),0)) or a helper column.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free