Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'm am setting up a spreadsheet to track fuel consumption and hour of heavy equipment. I have conditional formatting set to change the color of a cell when a peice of equipment is set for it's 250 service hour. How would I set an IF statement to start over every 250 hours? I'm sure it would be easier with a macro or VBA, but I have zero experience with those. I have put in about 5 hours trying to get this right, any help in the right direction would be very much appreciated.
Well, you say you want a Revolution Well, you know it's time.

I think we need another piece of information.
When the hours of operation gets above a 250 hour threshold and CF changes the color of the cell, how does your spreadsheet know that the maintenance has actually been performed? In other words, I don't think you want the cell reset at 256 if the maintenance hasn't been performed yet.
I can come up with a formula that will format the cell only at exactly 250 hour increments but I don't think that's what you want.

Actually that is exactly what I need, I have a check off area for service performed. The CF tells me to generate the work order and then I check it.
If you could show me that would be wonderful DerbyDad! I don't think I can afford to pull out anymore hair...:-)
Well, you say you want a Revolution Well, you know it's time.

I don't really think this is what you want, but...
If you CF cell A1 using Formula Is and use the formula below, it will get formatted only when A1 equals exactly 250, 500, 750, etc.
=MOD(A1,250)=0
The MOD function returns the remainder of the first argument (e.g. A1) divided by the second argument (250). If the remainder is 0, A1 gets formatted.
I've also PM'd an email address. If this isn't what you are looking for, perhaps you could email a copy of the spreadsheet so I can see what you are trying to do first hand.

Easiest solution is to use conditional formatting. Highlight the column where the numbers (0-250+) will be and click on Format -> Conditional Formatting. In there, set cell greater than or equal to 250 to hit the Format button and go to the Patterns tab and click on the red color (or whatever color) and hit OK to exit out.
Whenever it hits 250, it'll turn red.
I've also got a macro, if needed, that will count the number of red cells, so you could have a "Things needed to be fixed: ____" and have the next cell over be the sum of all red-highlighted cells.

25HG_Hoop:
I've been trying to get some more info from the OP because I don't think that is what he wants.
I *think* he wants the cell to turn red at each 250 hour milestone. i.e. The cell turns red at 250 hours. Then he uses another cell to note that the work is scheduled and/or done which turns off the red in the hour counting cell. Then when the hours reach 500, it turns red again until he resets it with the other cell. Then red at 750, 1000, 1250, etc.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |