# Lookup Value based on Date Span

I have a spreadsheet where I track expenses.

Over time mileage rates, etc. change

I could manually enter an updated rate after each change, but I'd like to do it with a lookup process

Attached is a copy of the spreadsheet - The value I want as the lookup result is on the Expense Tracking Tab - "Rate" and the table I want to use as the source is the mileage lookup tab

Does anybody know of an existing formula / calc that does type of lookup?

Thanks
EPM-Time-Tracking---Expense-Look.xlsx
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Hi,
pls try in Cell F2 and under

``````=IF(D2="Mileage",VLOOKUP(B2,'Mileage Rate Lookup'!\$B\$2:\$D\$3,3,TRUE),0)
``````
Regards

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Assistant Vice President\Network ManagerCommented:
or:

``````=IF(D2="Mileage",(IF(B2<'Mileage Rate Lookup'!\$B\$3,'Mileage Rate Lookup'!\$D\$2,'Mileage Rate Lookup'!\$D\$3)))
``````
Author Commented:
With a slight modification:

=IF(D2="Mileage",VLOOKUP(B2,'Mileage Rate Lookup'!\$B:\$D,3,TRUE),0)

This works great and allows for addition of newer mileage rates without any update.

Thanks
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.