Home

Formula for tracking service intervals on running equipment

%3CLINGO-SUB%20id%3D%22lingo-sub-482840%22%20slang%3D%22en-US%22%3EFormula%20for%20tracking%20service%20intervals%20on%20running%20equipment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482840%22%20slang%3D%22en-US%22%3E%3CP%3EGreetings%2C%20all.%26nbsp%3B%20I've%20been%20tasked%20with%20creating%20a%20live%20service%20interval%20tracking%20formula%20for%20our%20onsite%20equipment.%26nbsp%3B%20I%20have%20current%20hours%2C%20and%20service%20intervals%20are%20250%20hrs%20and%20500%20hrs%20respectively.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(AND((E30-C30)%26lt%3B500)%2C%22OK%22%2C%22SERVICE%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EC30%20%3D%20last%20serviced%20hrs%3C%2FP%3E%3CP%3EE30%20%3D%20current%20live%20hrs%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20wondering%20if%20there%20is%20a%20better%20formula%20I%20can%20use%3F%20I'm%20a%20caveman%20when%20it%20comes%20to%20Excel%2C%20so%20this%20is%20the%20best%20I've%20come%20up%20with%20%3A(.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3EI'd%20like%20to%20have%20OK%20in%20green%20and%20SERVICE%20in%20red.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20suggestions%20would%26nbsp%3B%20be%20greatly%20appreciated.%26nbsp%3B%20Thank%20you%20for%20your%20time.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20300px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110283i6D6CA49BE86863B4%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22EXCEL%20HELP.JPG%22%20title%3D%22EXCEL%20HELP.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EBP%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-482840%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-483275%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20for%20tracking%20service%20intervals%20on%20running%20equipment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-483275%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F327506%22%20target%3D%22_blank%22%3E%40_BP_%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFirst%2C%20better%20to%20define%20parameters%20of%20your%20formulas%20in%20the%20cells%20and%20not%20to%20hardcode%20in%20formulas.%20Plus%20give%20them%20some%20names%20to%20make%20formulas%20more%20understandable%20and%20friendly.%20Even%20better%20to%20keep%20them%20in%20separate%20from%20report%20sheet.%20For%20now%20let%20take%20in%20the%20same%20sheet%20as%20it%20was%20like%20this%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20438px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110519i6DDC072485A4A279%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ETo%20give%20the%20name%20stay%20on%20the%20cell%2C%20type%20in%20left%20upper%20box%20desired%20name%2C%20Enter.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENext%20select%20entire%20column%20D%2C%20Home-%26gt%3BConditional%20Formatting-%26gt%3BNew%20Rule%20and%20here%20select%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20504px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110520i0F4AE3EEBDC62E12%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ESelect%20proper%20rule%2C%20%22equal%20to%22%20from%20drop-down%20menu%2C%20next%20equal%20to%20what%20(don't%20forget%20%3D)%2C%20select%20desired%20format%20and%20Ok%20to%20close%20all%20these%20windows.%3C%2FP%3E%0A%3CP%3ERepeat%20the%20same%20for%20the%20ServiceLevel1.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENext%2C%20better%20to%20test%20the%20formulas%20for%20conditional%20formatting%20rules%20in%20separate%20columns.%20If%20the%20formula%20returns%20TRUE%20it%20will%20trigger%20the%20formatting%2C%20otherwise%20it'll%20be%20ignored.%20Start%20from%20the%20second%20row%2C%20be%20sure%20it%20works%20correctly%20for%20your%20rows%20with%20data.%20Copy%20it%20into%20te%20first%20row%2C%20it%20returns%20error%20but%20that%20doesn't%20matter%20in%20our%20case.%20Error%20is%20also%20result.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20795px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110523iAAA60F735E239748%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20select%20entire%20column%20F%2C%20new%20rule%20using%20formula%2C%20copy%20formula%20from%20cell%20M1%20(we%20have%20to%20select%20formula%20from%20first%20row%20from%20which%20our%20range%20starts)%20and%20paste%20it%20here.%20Apply%20format%20for%20the%20red%20and%20Ok.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20461px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110525i684EF80245932EE2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ERepeat%20the%20same%20for%20the%20alert%20(yellow%20rule)%2C%20and%20put%20it%20on%20the%20second%20place.%20Next%20Green%20and%20move%20it%20on%20the%20third%20place.%3C%2FP%3E%0A%3CP%3EFormulas%20are%20moved%20up%20and%20down%20by%20these%20arrows%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20542px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110526i09337B667E3C8090%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ESequence%20is%20important%20for%20thirst%20two%20rules%2C%20otherwise%20we%20have%20to%20complicated%20formulas%20(first%20we%20check%20if%20hours%20%26gt%3B%20limit%2C%20after%20that%20if%20%26gt%3B%20limit-gap.%20With%20such%20sequence%20it%20works%2C%20otherwise%20we%20shall%20check%20both%20boundaries%20for%20yellow%20rule).%3C%2FP%3E%0A%3CP%3EIn%20addition%2C%20for%20the%20green%20rule%20we%20check%20if%20Current%20Hours%20are%20not%20empty%20not%20to%20color%20blan%20cells.%3C%2FP%3E%0A%3CPRE%3E%3D((%24E1-%24C1)%26lt%3B%3DIF(%24D1%3DServiceLevel2%2CHoursSL2%2CHoursSL1)-HoursGap)%3CFONT%20color%3D%22%23FF0000%22%3E%3CSTRONG%3E*(%24E1%26gt%3B0)%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FPRE%3E%0A%3CP%3EForgot%20to%20say%2C%20I%20modified%20yout%20formula%20in%20column%20F%20as%20well%3C%2FP%3E%0A%3CPRE%3E%3DIF((E2-C2%26lt%3BIF(%24D2%3DServiceLevel1%2CHoursSL1%2CHoursSL2))%2C%22OK%22%2C%22SERVICE%22)%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482950%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20for%20tracking%20service%20intervals%20on%20running%20equipment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482950%22%20slang%3D%22en-US%22%3E%3CP%3ESounds%20good%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E.%26nbsp%3BTruly%20learning%20as%20I%20go.%26nbsp%3B%20Thanks%20for%20the%20link.%26nbsp%3B%20I%20will%20peruse%20it%20thoroughly.%26nbsp%3B%20I'm%20looking%20to%20create%20a%20parameter%20that%20includes%20a%2050%20hr%20warning%20color%20prior%20to%20service%20being%20due%20as%20well.%26nbsp%3B%20lol%26nbsp%3B%20Big%20dreams.%26nbsp%3B%20%26nbsp%3BGreen%20%3D%20OK%2C%20yellow%20%3D%2050%20hrs%20out%20from%20next%20service%2C%20red%20%3D%20SERVICE.%26nbsp%3B%20I%20update%20the%20hrs%20weekly.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482934%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20for%20tracking%20service%20intervals%20on%20running%20equipment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482934%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F327506%22%20target%3D%22_blank%22%3E%40_BP_%3C%2FA%3E%26nbsp%3B%2C%20please%20check%20this%20post%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.ablebits.com%2Foffice-addins-blog%2F2014%2F06%2F10%2Fexcel-conditional-formatting-formulas%2Fcomment-page-6%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.ablebits.com%2Foffice-addins-blog%2F2014%2F06%2F10%2Fexcel-conditional-formatting-formulas%2Fcomment-page-6%2F%3C%2FA%3E%26nbsp%3Bhow%20to%20work%20with%20conditional%20formatting.%3C%2FP%3E%0A%3CP%3EYour%20formula%20could%20be%20like%3C%2FP%3E%0A%3CPRE%3E%3D(%24E1-%24C1)%26lt%3B500%3C%2FPRE%3E%0A%3CP%3Efor%20the%20one%20color%2C%20and%20similar%20one%20for%20another.%20Two%20colors%20-%20two%20rules.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20provide%20small%20sample%20file%20I%20could%20illustrate%20details%20on%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482918%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20for%20tracking%20service%20intervals%20on%20running%20equipment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482918%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3Bthank%20you%20for%20your%20prompt%20aide.%26nbsp%3B%20Can%20you%20tell%20me%20what%20formula%20I%20would%20use%20to%20colour%20the%20column%20when%20Service%20is%20the%20result%20of%20the%20first%20formula%3F%20I%20am%20unclear%20where%20to%20even%20place%20the%20formula%2C%20nevermind%20how%20to%20scribe%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBP%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482877%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20for%20tracking%20service%20intervals%20on%20running%20equipment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482877%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F327506%22%20target%3D%22_blank%22%3E%40_BP_%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20don't%20need%20AND%20here%2C%20just%3C%2FP%3E%0A%3CPRE%3E%3DIF((E30-C30%26lt%3B500)%2C%22OK%22%2C%22SERVICE%22)%3C%2FPRE%3E%0A%3CP%3Eand%20you%20may%20use%20conditional%20formatting%20to%20color%20your%20cells%20automatically%20depends%20on%20hours%20difference.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-487534%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20for%20tracking%20service%20intervals%20on%20running%20equipment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-487534%22%20slang%3D%22en-US%22%3E%3CP%3EIndubitably%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%2C%20the%20best%20direction%20given%20to%20date%20for%20my%20exploits%20within%20Excel.%26nbsp%3B%20Thank%20you%20for%20the%20link%20and%20the%20walk%20through%20of%20creating%20the%20needed%20formulas.%26nbsp%3B%20I%20still%20have%20lots%20of%20reading%20and%20practicing%20to%20do%2C%20so%20I'll%20carry%20on.%26nbsp%3B%20Have%20a%20good%20weekend.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThx%20again.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBP%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-487881%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20for%20tracking%20service%20intervals%20on%20running%20equipment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-487881%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F327506%22%20target%3D%22_blank%22%3E%40_BP_%3C%2FA%3E%26nbsp%3B%2C%20you%20are%20welcome.%20Exploring%20Excel%20is%20never%20ended%20process%2C%20good%20luck%20here.%3C%2FP%3E%3C%2FLINGO-BODY%3E
_BP_
New Contributor

Greetings, all.  I've been tasked with creating a live service interval tracking formula for our onsite equipment.  I have current hours, and service intervals are 250 hrs and 500 hrs respectively.  

 

=IF(AND((E30-C30)<500),"OK","SERVICE")

 

C30 = last serviced hrs

E30 = current live hrs

 

I'm wondering if there is a better formula I can use? I'm a caveman when it comes to Excel, so this is the best I've come up with :(.  

I'd like to have OK in green and SERVICE in red.  

 

 

Any suggestions would  be greatly appreciated.  Thank you for your time.

EXCEL HELP.JPG

BP

 

7 Replies

@_BP_ ,

 

You don't need AND here, just

=IF((E30-C30<500),"OK","SERVICE")

and you may use conditional formatting to color your cells automatically depends on hours difference.

 

@Sergei Baklan thank you for your prompt aide.  Can you tell me what formula I would use to colour the column when Service is the result of the first formula? I am unclear where to even place the formula, nevermind how to scribe it.

 

BP

@_BP_ , please check this post https://www.ablebits.com/office-addins-blog/2014/06/10/excel-conditional-formatting-formulas/comment... how to work with conditional formatting.

Your formula could be like

=($E1-$C1)<500

for the one color, and similar one for another. Two colors - two rules.

 

If you provide small sample file I could illustrate details on it.

Highlighted

Sounds good, @Sergei Baklan. Truly learning as I go.  Thanks for the link.  I will peruse it thoroughly.  I'm looking to create a parameter that includes a 50 hr warning color prior to service being due as well.  lol  Big dreams.   Green = OK, yellow = 50 hrs out from next service, red = SERVICE.  I update the hrs weekly. 

@_BP_ ,

 

First, better to define parameters of your formulas in the cells and not to hardcode in formulas. Plus give them some names to make formulas more understandable and friendly. Even better to keep them in separate from report sheet. For now let take in the same sheet as it was like this

image.png

To give the name stay on the cell, type in left upper box desired name, Enter.

 

Next select entire column D, Home->Conditional Formatting->New Rule and here select

image.png

Select proper rule, "equal to" from drop-down menu, next equal to what (don't forget =), select desired format and Ok to close all these windows.

Repeat the same for the ServiceLevel1.

 

Next, better to test the formulas for conditional formatting rules in separate columns. If the formula returns TRUE it will trigger the formatting, otherwise it'll be ignored. Start from the second row, be sure it works correctly for your rows with data. Copy it into te first row, it returns error but that doesn't matter in our case. Error is also result.

image.png

 

Now select entire column F, new rule using formula, copy formula from cell M1 (we have to select formula from first row from which our range starts) and paste it here. Apply format for the red and Ok.

image.png

Repeat the same for the alert (yellow rule), and put it on the second place. Next Green and move it on the third place.

Formulas are moved up and down by these arrows

image.png

Sequence is important for thirst two rules, otherwise we have to complicated formulas (first we check if hours > limit, after that if > limit-gap. With such sequence it works, otherwise we shall check both boundaries for yellow rule).

In addition, for the green rule we check if Current Hours are not empty not to color blan cells.

=(($E1-$C1)<=IF($D1=ServiceLevel2,HoursSL2,HoursSL1)-HoursGap)*($E1>0)

Forgot to say, I modified yout formula in column F as well

=IF((E2-C2<IF($D2=ServiceLevel1,HoursSL1,HoursSL2)),"OK","SERVICE")

Indubitably, @Sergei Baklan, the best direction given to date for my exploits within Excel.  Thank you for the link and the walk through of creating the needed formulas.  I still have lots of reading and practicing to do, so I'll carry on.  Have a good weekend.

 

Thx again.

 

BP

@_BP_ , you are welcome. Exploring Excel is never ended process, good luck here.

Related Conversations
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
22 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
Edge insider Dev bypasses IE mode website list
HotCakeX in Enterprise on
4 Replies