JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,526
- Office Version
- 365
- Platform
- Windows
I have a workbook with records of items I buy regularly. Each product has its own sheet. There is one row for each purchase with columns for Date, Quantity, Price, Price per pound, etc.
Each sheet has a cell showing the lowest price (BestPrice) I ever paid and another showing the date of that purchase.
The named ranges are:
That all works. But some of these sheets have records going back many years. If the lowest price was 15 years ago, it's not really a fair comparison to today's prices.
Here's my question: How can I find the date of the lowest price paid in the last X years without writing a UDF?
Each sheet has a cell showing the lowest price (BestPrice) I ever paid and another showing the date of that purchase.
The named ranges are:
- RangeDate: The list of purchase dates
- RangePrice: The list or prices paid
Code:
=MIN(RangePrice)
=INDEX(RangeDate,MATCH(BestPrice,RangePrice,0))
That all works. But some of these sheets have records going back many years. If the lowest price was 15 years ago, it's not really a fair comparison to today's prices.
Here's my question: How can I find the date of the lowest price paid in the last X years without writing a UDF?