In a column to the left of the date, say column E, on the first row with data, enter this formula:
(There needs to be at least one row above the first data entry.
In this example the formula was placed in cell E2
Now drag this formula down to extend it alongside all rows containing data. You can go beyond the last row of data, so that new machine data can be entered without having to add this formula each time.
Note that if you inserted a new column on the source worksheet, to contain these formulas, you will need to change the reference to column Q to column R.
Column E will now have a sequential number for each time there is one of the three codes, 3, 5 or 10.
On the other worksheet in column A, say cell A2, enter this formula:
Change both end range values ($Q$22), to match the end of data on the source worksheet, and change the two worksheet names to match the name of your source worksheet. The end range can be further down the source worksheet than the current last data entry, to allow for new data to be added later).
If you start this formula on a different row, then you will have to change the two values "-1"
If you start in cell A3, then use -2
Drag the modified formula in cell A2 to cell B2, and change the column offset value from 3 to 11. The result will now be the minutes column (Col. O) rather than the machine number (Col. G).
Drag both formulas down as many rows as you will have machine codes - then carry on to add a margin of safety.
Excess rows of these formula will remain blank.
Columns A and B now have the results for all codes 3, 5 or 10, with no empty lines between the results.