# Need formula to calculate run hours based on cycle numbers

#### rahul27ragit

##### New Member
There are 3 types of machine which runs in a workshop. Start and stop cycle number are being maintain. I need help in calculating run hours (Highlighted yellow) before each stop. I want a formula so that it can be calculated automatically

 Date MACHINE Cycle Number Run Hours Answers 01-08-2021 MACHINE 1 2 2 01-08-2021 MACHINE 2 3 3 01-08-2021 MACHINE 3 7 7 02-08-2021 MACHINE 2 6 3 02-08-2021 MACHINE 1 15 13 03-08-2021 MACHINE 2 13 7 03-08-2021 MACHINE 1 26 11 03-08-2021 MACHINE 3 18 11 03-08-2021 MACHINE 2 27 14 04-08-2021 MACHINE 2 34 7 04-08-2021 MACHINE 1 41 15 04-08-2021 MACHINE 3 38 20 04-08-2021 MACHINE 2 51 17 05-08-2021 MACHINE 1 52 11 05-08-2021 MACHINE 2 63 12

### Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

#### StephenCrump

##### MrExcel MVP
Welcome to the Forum!

Try:

ABCD
1DateMACHINECycle NumberRun Hours
21/08/2021MACHINE 122
31/08/2021MACHINE 233
41/08/2021MACHINE 377
52/08/2021MACHINE 263
62/08/2021MACHINE 11513
73/08/2021MACHINE 2137
83/08/2021MACHINE 12611
93/08/2021MACHINE 31811
103/08/2021MACHINE 22714
114/08/2021MACHINE 2347
124/08/2021MACHINE 14115
134/08/2021MACHINE 33820
144/08/2021MACHINE 25117
155/08/2021MACHINE 15211
165/08/2021MACHINE 26312
Sheet1
Cell Formulas
RangeFormula
D2:D16D2=C2-SUMIF(B\$1:B1,B2,D\$1:D1)

#### rahul27ragit

##### New Member
Welcome to the Forum!

Try:

ABCD
1DateMACHINECycle NumberRun Hours
21/08/2021MACHINE 122
31/08/2021MACHINE 233
41/08/2021MACHINE 377
52/08/2021MACHINE 263
62/08/2021MACHINE 11513
73/08/2021MACHINE 2137
83/08/2021MACHINE 12611
93/08/2021MACHINE 31811
103/08/2021MACHINE 22714
114/08/2021MACHINE 2347
124/08/2021MACHINE 14115
134/08/2021MACHINE 33820
144/08/2021MACHINE 25117
155/08/2021MACHINE 15211
165/08/2021MACHINE 26312
Sheet1
Cell Formulas
RangeFormula
D2:D16D2=C2-SUMIF(B\$1:B1,B2,D\$1:D1)
Thank You so much Stephen

### Similar threads

Replies
11
Views
228
Replies
0
Views
92
Replies
17
Views
266
Replies
2
Views
644
Replies
1
Views
142

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Threads
1,151,836
Messages
5,766,716
Members
425,373
Latest member
ndiejennrrd

### 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

### 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