vendredi 27 novembre 2015

Divide time column in time spans based on several columns

So far I have managed fine using Excel's formulas, so I might not need VBA to solve this problem.

I want to create time spans in column V based on the times in column O. The time spans are: 00-05, 05-07, 07-09, 09-15, 15-18 and 18-00. Thus far I have been using the formula (example for row 25):

=IF([@Old]="","",IF([@Old]*24<5,"00-05",IF([@Old]*24<7,"05-07",IF([@Old]*24<9,"07-09",IF([@Old]*24<15,"09-15",IF([@Old]*24<18,"15-18","18-00"))))))

But I want the time spans to be conditional on column M as well, so that fx the time spans for rows 41 to 42 should still be 05-07, because they are in the batch that started in 05-07 (row 31). I have uploaded what the result should look like in the picture below. I also have a column that counts the start and end of the batch (from 1 and upwards). This might help to solve the issue, but I'm not sure how to do the expand the conditional if-statement.

Current How it should look like

Aucun commentaire:

Enregistrer un commentaire