Avatar of Curtis Long
Curtis Long
Flag for United States of America asked on

XLOOKUP?

I am trying to find an excel formula to lookup an amount in one column based on a date that is between a date range in two columns.  For example, column A has a start date, column B has an end date, and column E has the amount I need to find.  Is there a way to use XLOOKUP for this?  What would the formula look like if XLOOKUP will work?  Or do I have to use a really long nested IF statement?  I have Excel 365.
Microsoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Rob Henson

8/22/2022 - Mon
Saqib Husain

Can you set up a sample excel file for testing?
Tom Farrar

This link describes how to look up values based upon date ranges.  Think it might help, but may be better to see example as Saqib suggests..

https://www.excelhow.net/how-to-vlookup-to-return-value-if-date-falls-between-two-dates-in-excel.html
Curtis Long

ASKER
The sheet I am referencing is the Fuel Surcharge sheet.  On the Outside Hauling sheet, I need a formula in the "Mart FSC" column to pull the "Difference" amount that corresponds with the date in the "Date" column.  Does that make sense?
Fuel-Surcharge.xlsx
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
Saqib Husain

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Curtis Long

ASKER
Thank you for your help!  The XLOOKUP formula worked, and I was able to apply it to another column with a similar situation.
Rob Henson

Can also use standard VLOOKUP formula:

=VLOOKUP([@Date],Table1[#All],5,TRUE)

Fourth parameter in VLOOKUP allows for approximate match, in this case finds highest date that is not greater than look up value; in your example all dates are 2 March so will return value from 1 March as that is highest without going over.