0

I'm attempting to retrieve a value from a table with set dates

For example, given the table below, if a user entered the date 01/07/2019 it would retrieve D or 4. If a user entered 01/07/2017then it would retrieve B or 2.

    A           B           C   D   E
1   1/01/2016   31/12/2016      A   1
2   1/01/2017   31/12/2017      B   2
3   1/01/2018   31/12/2018      C   3
4   1/01/2019   31/12/2019      D   4
5   1/01/2020   31/12/2020      E   5
6   1/01/2021   31/12/2021      F   6
7   1/01/2022   31/12/2022      G   7

Note: Dates will never overlap.

I've seen examples of retrieving numbers using the INDEX function however i cannot get it to work with dates.

2

As your data is sorted you can use VLOOKUP:
=VLOOKUP(F1,$A$1:$D$7,3,TRUE) enter image description here

| improve this answer | |
  • 1
    Huh, I never even thought about using a Vlookup. For some reason I thought it matched on exact values only. Thanks! – zaza Aug 23 '16 at 11:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.