Hey guys, I have a huge spreadsheet with data since 2010 and I want to see prices per period, depending on year and for when the goods were sold. I have two columns with date, one is the day of trade(column B) and the other is day the goods will be delivered (column C), then I have a third column with price (D) - next two columns are where the formulas will go, Column (E) will be for nearby delivery and column (D) will be for future deliveries. I got another spreadsheet with defined names so I won't get lost too easy, these defined names are basically the start month and end month to determine the nearby shipment and future shipment.
Here is what my defined names look like to determine the deliveries for nearby & future
cellname |
From |
to |
cellname |
start10 |
July, 1, 2010 |
June, 3, 2011 |
finish10 |
start11 |
July, 1, 2011 |
June, 3, 2012 |
finish11 |
start12 |
July, 1, 2012 |
June, 3, 2013 |
finish12 |
start13 |
July, 1, 2013 |
June, 3, 2014 |
finish13 |
B |
C |
D |
E |
F |
Day of trade |
Delivery |
Price |
Nearby delivery |
Future delivery |
January, 5, 2010 |
Feb, 2013 |
4 |
formula1, false NA() |
formula2, True = D |
September, 10, 2010 |
April, 2011 |
15 |
formula1, True = D |
formula2, false NA() |
I have the following formula1 so far:
Code:
=IF(YEAR([@Closing])=2010,IF(C2>finish10,[@Diff], NA()))
I can't seem to figure out a way to do this code work for my whole spreadsheet, I need something like this:
If(YEAR(Day of trade cell) is between start10 and finish10 AND (delivery month&year) is also between start10 and finish10, show price) IF (YEAR(Day of trade cell) is between start11 and finish11 AND (delivery month&year) is also between start11 and finish11, show price)) this repeated until 2016 // there are about 11k lines on this, which is why I wanted this formula to auto-determine.
My problem that I can't figure out how to make formulas 1 and 2:
Formula1 Column E
case 1: If day of trade (column B) January 2010, it checks if the delivery date (column is between start10(July 2009 ) and finish10(June 2011), if true then value of cell = price cell (column D), if false, NA()
case 2: if day of trade (column B) is October 2011, it checks if delivery date is a nearby delivery date: July 2011 (start11) and June 2012(finish12) then it has to see if the delivery date is between the same period, and so on... until today's date.
Formula2 Column F
If day of trade is for instance January 10, it has to see if the delivery date is bigger than finish10, if true then the value is price of cell, if not, NA()
Thanks in advance for any help or tips on this
Bookmarks