Is date within a range?

A

AndrewB

I have a list of date & times of deliveries. I also have a list of date &
times of price changes.
I want to identify if, for each delivery time, it falls within 7 hours
either side of any one of the price changes and, if so, which side.

Can anyone help? It would be much appreciated :)
 
H

hrlngrv - ExcelForums.com

AndrewB wrote...
I have a list of date & times of deliveries. I also have a list of date &
times of price changes. I want to identify if, for each delivery time, it
falls within 7 hours either side of any one of the price changes and, if so,
which side.

Given a date/time of delivery, D, and the date time of a price change,
C, the formula you seek is

=IF(ABS(D-C)<=7/24,IF(D<C,"Before","On or After"),"Outside 7
Hours")

If there were m delivery dates/times in a horizontal range D and n
price change dates/times in a vertical range C, the formula above
would be an array formula that would return an m-column by n-row
array result.
 
P

Peo Sjoblom

hrlngrv - ExcelForums.com said:
AndrewB wrote...

Given a date/time of delivery, D, and the date time of a price change,
C, the formula you seek is

=IF(ABS(D-C)<=7/24,IF(D<C,"Before","On or After"),"Outside 7
Hours")

If there were m delivery dates/times in a horizontal range D and n
price change dates/times in a vertical range C, the formula above
would be an array formula that would return an m-column by n-row
array result.

Coffeecozy.com?

--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top