Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Match dates and prices
thanks in advance for anybody that could provide me with help on this
part of code that is - I guess - possibly very easy to write but I have no idea of how to sort it out. I have a column A containing product names. Only two products exist and they are irregularely sorted as Column A Product A Product B Product B Product A Product B Product A and so on the lenght of this column will be irregular from day to day. It can be 7 lines today, 12 tomorrow, 100 the day after. On column B, I have dates which are associated with products. Dates would always be in ascending order, from the most recent to the most distant from now on, whatever the sorting of Products in column A. It would thus look as: Column A Column B Product A 21/04/2006 Product B 19/05/2006 Product B 22/06/2006 Product A 11/07/2006 Product B 12/08/2006 Product A 05/09/2006 and so on On column P, I would have a serie of dates, sorted by ascending order, from the most recent to the most distant from now on, all corresponding to product B dates, such as Column P 19/05/2006 22/06/2006 12/08/2006 and possibly more, if Column A includes more "Product B" lines. Column R associate the prices of "Products B" at a certain point in time ie Column P Column P Column R 19/05/2006 250 22/06/2006 180 12/08/2006 370 and so on, function of the number of "product B" present in Column A. On this basis, what I am aiming to do, is to match in Column C the price existing in Column R for the "Product B" from Column A with corresponding Column B date, or for instance Column A Column B Column C Product A 21/04/2006 Product B 19/05/2006 250 Product B 22/06/2006 180 Product A 11/07/2006 Product B 12/08/2006 370 Product A 05/09/2006 I could implement a vlookup in Column C, linked to columns P, R. But user would crash the formula for sure. I thus need matching to be made in VB code and "pushed" into Column C. Moreover, a vlookup would not sort the fact that columns A, B can be made of 10 or 1000 lines, from one day to the other. I am, obviously, unable to code this. I thus would be extremely thankful to any help that anybody can provide... I wish you all the best Daniel |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula to match different ranges of time and prices | Excel Worksheet Functions | |||
How to match 2 prices | Excel Worksheet Functions | |||
EXCEL - formula for linking dates and prices | Excel Worksheet Functions | |||
Using MATCH with dates | Excel Worksheet Functions | |||
Use a multiplier to change List Prices to Net prices | Excel Worksheet Functions |