Forum Discussion

sheik_nadia's avatar
sheik_nadia
Copper Contributor
Sep 12, 2024

I have 10 trucks that needs a components replacement for every cummaltive 60000km.

I have 10 trucks that needs a components replacement for every cummaltive 60000km. I have my trucks in column A. Amd cumulative kms by month in the rest of the columns. The trucks needs a components ...
  • NikolinoDE's avatar
    Sep 13, 2024

    sheik_nadia

    To highlight the months where each truck reaches the cumulative distance of every 60,000 km (i.e., 60,000 km, 120,000 km, 180,000 km, etc.), you can achieve this by combining a formula to detect these milestones and using Conditional Formatting to highlight the cells where the cumulative km requirement is met.

    Step-by-Step Process:

    1. Data Structure Setup:

      • Column A: Truck names (e.g., A2 for 10 trucks).
      • Columns B onward: Cumulative kilometers by month for each truck (e.g., B2).   

          2. Example layout:

    A             | B        | C         | D         | ... | M

    --------    |------    |------    |------     |---.|-----

    Truck 1 | 5000   | 15000| 22000| ... | 60500

    Truck 2 | 10000 | 25000| 31000| ... | 120500

    Truck 3 | 20000 | 35000| 60000| ... | 180000

          3. In this case, each row represents the cumulative kilometers for a particular truck by month.

         4. Formula to Identify Replacement Milestones: To detect when a truck reaches every multiple of 60,000 km (i.e., 60,000 km, 120,000 km, 180,000 km, etc.), you can use the following formula for conditional formatting:

    Formula:

    =MOD(B2,60000)=0

    This formula checks if the cumulative kilometers in a particular cell is exactly divisible by 60,000. If it is, the condition will be TRUE, meaning that the truck has hit a replacement milestone in that month.

         5. Applying Conditional Formatting:

    1. Select the Range: Select the range where your cumulative kilometers are listed (e.g., B2:M11).
    2. Open Conditional Formatting: Go to Home > Conditional Formatting > New Rule.
    3. Use a Formula to Determine Which Cells to Format: Choose Use a formula to determine which cells to format.
    4. Enter the Formula: Enter the following formula (assuming your data starts in cell B2):

    =MOD(B2,60000)=0

         5. Set the Format: Click Format, and choose a color to highlight the cells where the formula is true (i.e., where the truck reaches every multiple of 60,000 km).

         6. Apply: Click OK to apply the conditional formatting rule.

     

    Explanation of the Formula:

      • MOD(B2, 60,000) = 0: The MOD function returns the remainder when dividing the cumulative km value by 60,000. If the remainder is 0, it means that the cumulative km is exactly a multiple of 60,000, indicating that the truck needs a component replacement.

    Example:

    Assume Truck 1 in row 2 has the following cumulative kilometers across months:

    Truck 1 | 5000 | 15000 | 22000 | 33000 | 60500 | 121000 | ...

    • When the cumulative kilometers hit 60,000 km (between 33,000 km and 60,500 km), the cell with 60,500 km will be highlighted.
    • The same will happen for 120,000 km (or the nearest cumulative km that is >= 120,000) and so on.

    Summary:

    • Use the formula =MOD(B2,60000)=0 in Conditional Formatting to flag the cells where the truck reaches every multiple of 60,000 km.
    • This approach will automatically adjust for each truck and each month as the cumulative kilometers increase. The text, steps and functions were created with the help of AI.

    My answers are voluntary and without guarantee!

     

    Hope this will help you.

    Was the answer useful? Mark as best response and Like it!

    This will help all forum participants.

Resources