Forum Discussion

ClausDaniel's avatar
ClausDaniel
Copper Contributor
Oct 17, 2023
Solved

How to make Excel calculate if X is present within time period.

Hello,   First time posting, so let me just get straight to it.   I have a long period of time, where I have digital registration information about salary.   This includes Registration date for...
  • OliverScheurich's avatar
    OliverScheurich
    Oct 18, 2023

    ClausDaniel 

    If you work with danish Excel the whole formula has to be translated into danish. If you open my attached file the formula is translated according to your regional setting. The formula only works in Excel for Microsoft 365, Excel for Microsoft 365 for Mac and Excel for the web.

     

    Below is what i get from a translator but i assume that in danish Excel there isn't a BYROW formula and the TEKST format "DD.MM.YYYY" is certainly different in danish Excel. And i wonder if SUM, LAMBDA and LET are the same in english and danish Excel.

     

    =LET(timeperiod;BYROW(SEKVENS(A2-A73;;0);LAMBDA(x;HVIS(SUM(FILTRER(B2:B73;(A2:A73<=DATO(ÅR(A2);MÅNED(A2);DAG(A2)-x))*(A2:A73>=DATO(ÅR(A2)-3;MÅNED(A2);DAG(A2)-x+1))))>3550;TEKST(DATO(ÅR(A2);MÅNED(A2);DAG(A2)-x);"DD.MM.YYYY")&"-"&TEKST(DATO(ÅR(A2)-3;MÅNED(A2);DAG(A2)-x+1);"DD.MM.YYYY");"")));

    len;BYROW(timeperiod;LAMBDA(x;LÆNGDE(x)));

    HVIS.FEJL(FILTRER(timeperiod;len);"no result"))

Resources