Forum Home
Press F1
 
Thread ID: 145837 2018-02-08 00:22:00 Excel formula. Bryan (147) Press F1
Post ID Timestamp Content User
1446023 2018-02-08 00:22:00 I am trying to create a motor kilometres formula. Simply in two columns I want to show total of kilometres travelled by the car and in the second column, actual kilometres travelled since I last filled the car.

ie: Current total of Car = 33000.
Current total of Car = 33500. Kilometres since last filled = 500
Current total of Car = 34200. Kilometres since last filled = 700


So what I want to do is find a formula that will automatically calculate each Kilometres, since last filled. In column D, =SUM(C2:-C1) doesn't work.
Bryan (147)
1446024 2018-02-08 00:26:00 =C2-$C1 ?? dugimodo (138)
1446025 2018-02-08 01:57:00 =C2-C1
=C3-C2
=C4-C3

Copying that down the screen will automatically increment the cell numbers.
decibel (11645)
1446026 2018-02-08 03:32:00 Used to do a similar thing for bh's private work mileage: Lurking (218)
1446027 2018-02-08 04:13:00 Thank you gentlemen. I'm now on the right track. Bryan (147)
1446028 2018-02-08 21:53:00 I prefer to use an "If" Function as just doing a Subtraction will give some funny results until the Primary number has been entered for that Row.

Subtraction only =SUM(C2-C1)
With If Function =IF(C2;C2-C1;"")
Note in both cases shown here the Formula is actually started in Row 2.
You can of course add Headers at the top (which I presume you have).
Jedsdad (17435)
1