I have a table "TermDates" which is updated with term dates and the corresponding term names:
And another series of tables eg. "AnnualSpend20" which includes payment dates:
I'm looking for a formula to insert in AnnualSpend20[@[Term]] that will lookup the [@[Payment Date]] to see which date range it falls into in TermDates and return the corresponding term name.
This is what I have tried so far, but is returning #N/A error - presumably this formula is only for cell references rather than table references?
=INDEX(TermDates[Term],MATCH(1,IF([@[Payment Date]]>TermDates[Start Date],IF([@[Payment Date]]<TermDates[End Date],1)),0))
Please help and thank you!
Academic Year | Term | Start Date | End Date |
2019-20 | Michaelmas | 31/08/2019 | 01/01/2020 |
2019-20 | Lent | 31/12/2019 | 01/04/2020 |
2019-20 | Trinity | 31/03/2020 | 30/09/2020 |
2020-21 | Michaelmas | 31/08/2020 | 01/01/2021 |
And another series of tables eg. "AnnualSpend20" which includes payment dates:
Item # | Payment Date | Term |
123456 | 23/12/2019 | |
123457 | 01/02/2020 | |
123458 | 14/3/2020 | |
123459 | 15/06/2020 | |
I'm looking for a formula to insert in AnnualSpend20[@[Term]] that will lookup the [@[Payment Date]] to see which date range it falls into in TermDates and return the corresponding term name.
This is what I have tried so far, but is returning #N/A error - presumably this formula is only for cell references rather than table references?
=INDEX(TermDates[Term],MATCH(1,IF([@[Payment Date]]>TermDates[Start Date],IF([@[Payment Date]]<TermDates[End Date],1)),0))
Please help and thank you!