Querying Based on Historical Price

CT Witter

MrExcel MVP
Joined
Jul 7, 2002
Messages
1,212
I'm having a tempory loss of how to accomplish this. I have a table that has equipment id, cost and start and end date. I want to obtain the cost at a certain point in time based on the start / end date and the date the user provides.

Below is a copy of my table.
cost.xls
ABCD
1EquipIDCOSTStartDateEndDate
21$1,200.001/1/200512/31/9999
32$1,500.001/1/20051/15/2005
42$1,700.001/16/200512/31/9999
54$1,700.001/1/200512/31/9999
65$1,900.001/1/200512/31/9999
76$2,400.001/1/200512/31/9999
Sheet1



The user provides a date ie 1/13/05 for equipment id 2, the cost should be 1200. If they provided 1/16/05, then cost would be 1700.

Should I set up my table differently?

Thanks,
CT
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
With a query it would look like that.

Select cost from table where Date > startdate and date < Endate.
 
Upvote 0

Forum statistics

Threads
1,206,970
Messages
6,075,921
Members
446,170
Latest member
zzzz02

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top