Feb 20 2024 02:11 AM
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 empty cells in the row until i.e. "event 1" is reached
I want to display the weeks it takes until a that "event 1" is reached from today (in C4, C5 or D4, D5). It would be perfect if excel can refer to the actual current date the file is opened.
Either by counting the empty cells from the current week or by a formula that refers to the week it takes place and then counts backwards with the dates.
Does anyone have a straightforward solution. Would be really thankful!
Feb 20 2024 02:32 AM
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:
Explanation:
How to use the formula:
Additional notes:
This formula should provide the desired number of weeks until each event, taking into account the current date and empty cells in the timeline.
Feb 20 2024 02:56 AM
=IFNA(FLOOR(INDEX($F$4:$V$4,MATCH(C$4,$F5:$V5,0))-TODAY(),7)/7,"")
This formula with INDEX and MATCH could be an alternative. The formula is in cell C4 and filled across range C4:D5.
Feb 20 2024 04:37 AM - edited Feb 20 2024 04:41 AM
I wrote a formula that returns results for an entire table as a dynamic array. It may not be precise in terms of counting weeks inclusive or exclusive and it also contains a fail. It does not list weeks to go to an array of future events as an array, because that requires 'an array of arrays' which, for some technical reason that eludes me, Microsoft considers to be 'sinful'.
My formula is
= BYROW(events,
LAMBDA(e,
LET(
futureEvent?, (dateLine>TODAY()) * ISTEXT(e),
weeksToGo, WEEKNUM(FILTER(dateLine, futureEvent?)) - WEEKNUM(TODAY()),
TEXTJOIN(", ", , weeksToGo)
)
)
)
The formula only considers future dates (Event0 is filtered out) and the results are presented as an array of comma-separated lists.