I have a table of orders that include multiple transaction dates which indicate which step of the order process was completed on what date. The sequence in which these steps are completed varies from transaction to transaction. With the exception of the creation date, each date is the date that step was completed.
I'm trying to automate the calculation of how many days a given step took. In row 2, the calculation would be fairly straightforward as the "steps" all took place in the same order as their column arrangement. A formula could be written (and was) that calculates the number of days between 2 column unless it's neighbour is blank. Works perfectly as long as the order follows the column arrangements.
If the dates don't flow, as in rows 5 and 6 for example, then the answer to the days calculation is meaningless.
I'm thinking that each row needs to be sorted and calculated without losing track of it's label. I have zero VBA foo and haven't been able to formula my way to a solution yet.
I'm trying to automate the calculation of how many days a given step took. In row 2, the calculation would be fairly straightforward as the "steps" all took place in the same order as their column arrangement. A formula could be written (and was) that calculates the number of days between 2 column unless it's neighbour is blank. Works perfectly as long as the order follows the column arrangements.
If the dates don't flow, as in rows 5 and 6 for example, then the answer to the days calculation is meaningless.
I'm thinking that each row needs to be sorted and calculated without losing track of it's label. I have zero VBA foo and haven't been able to formula my way to a solution yet.
Rich (BB code):
Excel Workbook
A B C D E F G H I J K 1 Work Order Customer Order Open 1st Inspection Quote Waiting for PO Waiting for Parts Repair With Vendor COD Shipped 2 28004 Jim 17/01/12 06/02/12 09/02/12 13/02/12 13/02/12 13/02/12 na 13/02/12 13/02/12 3 29486 Joe 18/01/12 25/01/12 25/01/12 25/01/12 25/01/12 10/02/12 na 10/02/12 10/02/12 4 31496 Bob 04/07/11 12/10/11 05/10/11 05/10/11 05/10/11 23/01/12 na 5 32269 Ryan 12/01/12 30/01/12 13/02/12 31/01/12 31/01/12 10/02/12 6 33606 Frank 05/12/11 20/12/11 20/12/11 20/12/11 20/12/11 22/01/12 20/01/12 7 30039 Peter 09/02/12 10/02/12 14/02/12 14/02/12 12/02/12 na 8 27753 Albert 30/01/12 07/02/12 08/02/12 07/02/12 na 9 31262 Dave 17/06/11 20/09/11 22/07/11 22/07/11 22/07/11 14/02/12 na 10 32804 Adam 21/09/11 23/11/11 na na na 09/02/12 na 11 12161 Chris 26/09/11 28/09/11 10/01/12 28/09/11 10/01/12 19/01/12 na 12 20841 Craig 04/10/11 11/10/11 11/10/11 11/10/11 13/10/11 18/01/12 na 13 85016 John 19/10/11 18/11/11 19/10/11 19/10/11 19/10/11 10/02/12 na 14 54116 Tom 06/12/11 14/12/11 14/12/11 14/12/11 14/12/11 24/01/12 na Sheet1
Excel 2010