Calculating hours to next service

DevonLeukes

New Member
Joined
May 6, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi

I am trying to write either a VBA code or just apply a formula (if possible) to determine how many hours a vehicle has left before the next service is due. The idea is that the user will enter the hour reading on the vehicle daily at the beginning of the shift and the output will be an indication of how many hours is available before the next service.

Criteria is as follows:
1. Between 0 and 1000hrs a service is required every 500hrs
2. Above 1000hrs a service is required every 250hrs

It should look something like below where the "hours to next service" is calculated

Forklift 1Forklift 2
Total running hours
200​
1400​
input by user
Hours to next service
300​
100​
output required
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
This should do what you need
The List.xlsx
ABCD
1Forklift 1Forklift 2
2Total running hours2001400input by user
3Hours to next service300100output required
Sheet12
Cell Formulas
RangeFormula
B3:C3B3=CEILING(B2,IF(B2<1000,500,250))-B2
 
Upvote 0

Forum statistics

Threads
1,215,032
Messages
6,122,772
Members
449,095
Latest member
m_smith_solihull

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

Which adblocker are you using?

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
Back
Top