Forum Discussion
Stefan2495
Feb 20, 2024Copper Contributor
EXCEL Deadline-tracker: Counting/ displaying weeks until you reach an event
Hi Community, I want to display the number of weeks it takes until an event is happening for a certain Item (B4, B5, etc.). My timeline is in weeks on the x-axis increasing to the right. There are e...
smylbugti222gmailcom
Feb 20, 2024Iron Contributor
Based on the information you've provided and the image, here's a formula you can use in Excel to calculate the number of weeks until an event occurs for a specific item, considering the current date:
Excel
=IF(WEEKNUM(B4)="", "", CEILING((WEEKNUM($A$1:$A$255) - WEEKNUM(B4)) / 52, 1) + WEEKNUM(TODAY()) - WEEKNUM(B4))
Explanation:
- WEEKNUM(B4): This part checks if the cell containing the event name (e.g., B4) is empty. If empty, it returns "", otherwise, it proceeds with the calculation.
- WEEKNUM($A$1:$A$255): This creates an array of week numbers from cells A1 to A255 in your timeline.
- WEEKNUM(B4): This gets the week number of the event date (assuming it's in cell B4).
- CEILING((WEEKNUM($A$1:$A$255) - WEEKNUM(B4)) / 52, 1): This calculates the number of years between the current week (from the timeline) and the event week, rounded up to the nearest whole year using CEILING. The division by 52 converts weeks to years.
- **+ WEEKNUM(TODAY()): This gets the week number of today's date.
- - WEEKNUM(B4): This subtracts the week number of the event date from the current week and the calculated years, providing the remaining weeks until the event.
How to use the formula:
- Copy the formula and paste it into cells C4, C5, or any other cells where you want to display the remaining weeks for each item.
- Adjust the cell references (e.g., B4, A1:A255) if your event names and timeline location differ.
Additional notes:
- This formula assumes your week numbers are in column A. If they're in a different column, adjust the references accordingly.
- You can adjust the range A1:A255 to cover the extent of your timeline data.
- This formula considers weeks within the current year. If events span multiple years, adjustments might be needed.
This formula should provide the desired number of weeks until each event, taking into account the current date and empty cells in the timeline.