How to lookup a date in a range and return a value if found

Akkedis

New Member
Joined
Oct 9, 2014
Messages
2
Hello experts!
How can I find a value in a list that is dependent on a entered date being found in a date range?
Eg.
I have a list of materials with valid-from and valid-to dates, and prices for those materials (in A1:D9)
Now I enter a order date (B12), and a list of materials (A14:A16).
Question: How do I find the correct price per material (B14:B16) based on my Order Date?
See sheet below:

ABC D E
1MaterialValid fromValid to Price
2Pen25.10.201331.12.2013 95.00
3Pen01.01.201424.10.2014 150.00
4Pen25.10.201431.12.2014 100.00
5Brush25.10.201310.03.2014 200.00
6Brush11.03.201431.12.2014 205.00
7Ruler25.10.201331.12.2013 99.00
8Ruler01.01.201424.10.2014 103.00
9Ruler25.10.201431.12.2014 111.00
10
11
12Order Date:15.10.2014
13MaterialPrice
14Pen
?
15Brush
?
16Ruler
?

<tbody>
</tbody>


Thanks in advance!
 

Some videos you may like

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,110
Office Version
  1. 365
Platform
  1. Windows
Hi

Try:

=SUMIFS($D$2:$D$9,$A$2:$A$9,A14,$B$2:$B$9,"<"&$B$12,$C$2:$C$9,">"&$B$12)
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,110
Office Version
  1. 365
Platform
  1. Windows
Actually should be this to be inclusive:

=SUMIFS($D$2:$D$9,$A$2:$A$9,A14,$B$2:$B$9,"<="&$B$12,$C$2:$C$9,">="&$B$12)
 

Watch MrExcel Video

Forum statistics

Threads
1,109,423
Messages
5,528,681
Members
409,829
Latest member
CFreeamaz

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top