Lag dates

Texas Longhorn

Active Member
Joined
Sep 30, 2003
Messages
493
Hi all,

I have a sheet with some dates for company filed reports. I am trying to make the data point-in-time (i.e. where I can reference data based on when it was known as opposed to the period it covers). Here is an example of what I'm doing:

Book3
ABCDEF
7MONTHENDSYMBOLADJ_FISCAL_DATEADJ_REPORT_DATELagDateDesired
82/28/20064595061012/31/20051/26/2006
93/31/2006459506103/31/20064/26/20061/26/20061/26/2006
104/30/2006459506103/31/20064/26/20064/26/20064/26/2006
115/31/2006459506103/31/20064/26/20064/26/20064/26/2006
126/30/2006459506106/30/20067/26/20064/26/20064/26/2006
137/31/2006459506106/30/20067/26/20067/26/20067/26/2006
148/31/2006459506106/30/20067/26/20067/26/20067/26/2006
159/30/2006459506109/30/200611/1/20067/26/20067/26/2006
1610/31/2006459506109/30/200611/1/200611/1/20067/26/2006
1711/30/2006459506109/30/200611/1/200611/1/200611/1/2006
1812/31/20064595061012/31/20061/30/200711/1/200611/1/2006
191/31/20074595061012/31/20061/30/20071/30/20071/30/2007
202/28/20074595061012/31/20061/30/20071/30/20071/30/2007
213/31/2007459506103/31/20075/3/20071/30/20071/30/2007
224/30/2007459506103/31/20075/3/20075/3/20071/30/2007
235/31/2007459506103/31/20075/3/20075/3/20075/3/2007
246/30/2007459506106/30/20078/7/20075/3/20075/3/2007
257/31/2007459506106/30/20078/7/20078/7/20075/3/2007
268/31/2007459506106/30/20078/7/20078/7/20078/7/2007
279/30/2007459506109/30/200710/31/20078/7/20078/7/2007
2810/31/2007459506109/30/200710/31/200710/31/200710/31/2007
2911/30/2007459506109/30/200710/31/200710/31/200710/31/2007
3012/31/20074595061012/31/20071/30/200810/31/200710/31/2007
311/31/20084595061012/31/20071/30/20081/30/20081/30/2008
324/30/2007599874323/31/20075/3/2007 
335/31/2007599874323/31/20075/3/20075/3/20075/3/2007
346/30/2007599874326/30/20078/7/20075/3/20075/3/2007
357/31/2007599874326/30/20078/7/20078/7/20075/3/2007
368/31/2007599874326/30/20078/7/20078/7/20078/7/2007
379/30/2007599874329/30/200710/31/20078/7/20078/7/2007
3810/31/2007599874329/30/200710/31/200710/31/200710/31/2007
3911/30/2007599874329/30/200710/31/200710/31/200710/31/2007
4012/31/20075998743212/31/20071/30/200810/31/200710/31/2007
Sheet1


In column F, I've highlighted in yellow the instances where my simple formula in column E has failed and put in my desired result. Basically, if the value in column D is less than or equal to the value in column A, I want to use the value in column D (I've got that part); if the value in D is greater than the value in A, I want to pull in the date which meets these three criteria: 1. It is less than or equal to the value in A; 2. Of the dates for which criteria 1 is true, I want the date which is smaller by the least amount; and 3. The date has to be for the same symbol (column B).

Any help would be much appreciated. I'm thinking of adding a column for the difference between column D and A, but I'm not sure yet how to use that.

Please let me know if I can clarify anything.

Thanks,

Bill
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

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