I am trying to get a unit price for a particular PO# based on a selected date. I need to get the current unit price and compare it to the last unit price recorded, which could be different dates for each PO#. This last part is the one I am having problems with.
I am not having a problem grabbing the last date that the PO# has a unit price. I am using the following formula to find that date:
This works great and tells me the last instance of the date based on my current date selection for each PO#. Now I just need to grab the unit price at those dates. For instance, below if I select 8/1/09, I want to grab the unti price for 7/1/09 for PO# 1 of 15.50, and the unit price of 7/2/09 for PO# 2 of 10.50, etc.
PO#
Site
Date
Unit Price
1
south
8/1/2009
20.50
1
east
7/1/2009
15.50
1
west
6/1/2009
10.50
2
south
8/1/2009
9.00
2
west
7/2/2009
10.50
2
west
6/1/2009
10.50
3
west
8/1/2009
9.00
3
west
6/1/2009
25.00
4
north
7/3/2009
30.00
4
east
6/1/2009
18.00
I can get it to provide the dates using the max function above, but when I try to get the unit price, I am having trouble. My thought was to nest the first formula into another set analysis (in bold below) where I would set the PODate equal to the date evaluated from above. When I use the below, the nested max statement only gives me one date and not the individual dates from the original formula.
Not sure if that has to do with the double quotes I used?? It won't evaluate anything if I use anything other than the double quotes for the nested set analysis.
Maybe I am looking at this the wrong way or using the wrong function for the second part?