We keep track of the tons that we haul in our trucks. Each month since 1997 I have entered the tons we hauled each month. The data is categorized by the year and then the months for that year.
Each month of the current year, I want to be able to compare the amount of tons brought in from the beginning of the year to the current month of the current year to the past years from the beginning of the year to the current month for that past year.
In this example, I want the sum in the “Tons to Month” row for the 2021 column to Sum Jan through Jun, and I want the column for 2022 to add Jan through Jun of 2022.
Currently, I just make a Sum formula in “Tons to Month” and add up the tons from Jan to Jun for each year.
Instead, what I want to do is have a formula in “Tons to Month” that would point to a cell where I enter “Jun” (this happens to be the current month that I am looking for the data for) and the formula returns the Sum of Jan through Jun. This way, I only enter “Jun” in one cell, and all the “tons to Month” get updated in each years’ column.
Each month of the current year, I want to be able to compare the amount of tons brought in from the beginning of the year to the current month of the current year to the past years from the beginning of the year to the current month for that past year.
In this example, I want the sum in the “Tons to Month” row for the 2021 column to Sum Jan through Jun, and I want the column for 2022 to add Jan through Jun of 2022.
Currently, I just make a Sum formula in “Tons to Month” and add up the tons from Jan to Jun for each year.
Instead, what I want to do is have a formula in “Tons to Month” that would point to a cell where I enter “Jun” (this happens to be the current month that I am looking for the data for) and the formula returns the Sum of Jan through Jun. This way, I only enter “Jun” in one cell, and all the “tons to Month” get updated in each years’ column.
Year | 2021 | 2022 |
Tons to month | 16,376 | 16,299 |
Jan | 2,572 | 2,635 |
Feb | 2,352 | 2,327 |
Mar | 2,876 | 2,767 |
Apr | 2,877 | 2,638 |
May | 2,638 | 2,813 |
Jun | 3,062 | 3,117 |
Jul | 3,121 | 102 |
Aug | 2,925 | 0 |
Sep | 2,747 | 0 |
Oct | 2,720 | 0 |
Nov | 2,784 | 0 |
Dec | 2,608 | 0 |