google-sheets-apigoogle-workspace

=IFERROR(Rounddown(datedif(B2,C2,"D")/7)) Make this show the weeks up to the date even if I don't have an end date yet


In google sheets I am using this formula to currently calculate the amount of time that has taken place between two dates. =IFERROR(Rounddown(datedif(B2,C2,"D")/7))

Is there something I can add to this formula to make it show the number of weeks up to todays current date? Currently it only shows me the weeks between the dates if I have an end date.

I think I showed above, that is all I have tried. I am not sure what to google to get the results Im looking for.


Solution

  • Here's another method you may try:

    =ARRAYFORMULA(IF(NOT(ISBLANK(A2:A)), ARRAYFORMULA(IF(B2:B = "", FLOOR((NOW()-A2:A)/7), FLOOR((B2:B-A2:A)/7))), " "))
    

    Example Data

    This should also resolve the part where you're getting random numbers on cells that don't have any start and end dates.