Oct 17 2023 03:36 AM
Oct 17 2023 03:36 AM
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 the payslip and number of working hours on the payslip.
So basically every month of salary has a line in Excel, and each line has registration date (column D) and number of hours (Column E). (and more).
Let's say I have 8 years of this data, and I need to know if there, anywhere in this 8 year period, is a 3 year period with 3848 or more hours. (The 3 year periode needs to be decided bu the registration date).
How would one do that? (keep in mind I am a novice in Excel).
Hopes my question makes sense.
Version is Microsoft office 365.
Oct 17 2023 03:54 AM
I can't rebuild your dataset therefore i've set up a small example to check if the sum within 5 days exceeds 60. In this example only the sum from 08.01.2023 to 12.01.2023 exceeds 60.
Oct 17 2023 11:07 PM - edited Oct 17 2023 11:39 PM
Thank you for your reply, maybe it is my lacking understanding of Excel in general, but I can't make your formula work for my dataset.
Below is an example of a fictional dataset that would be like the ones I would have to do this task on.
So lets take the first row as an example, the registration date is 28-09-2023. Meaning that i need to know if there is 3848 in the column "hours", in the periode 29-09-2020 - 28-09-2023 (3 years). But that is just an example, like in your formula the period that has the 3848 hours can be in any 3 year period with in the allowed dataset. (It would also be preferable if the period that fulfills the 3848 hours, would be visible in some way. Maybe if Row A5 - A50 fulfills the 3848 hours, it would be shown that it is these specific rows that fulfill it).
So here is an example dataset:
Oct 18 2023 01:47 AM
This formula returns the periods for which the sum within 3 years is above 3550. In the sample data the formula would return "no result" for 3848 because there isn't a 3 year period with sum over 3848.
The assumption is that 28.09.2023 is the latest date and 29.05.2019 is the earliest date in the Reg. date. column. Then the formula calculates the sum for all ranges
and so on. Then it checks for each range if the sum is above 3550 and if so it returns the time range otherwise a blank cell. In the last step the data is filtered to only return the ranges with sum above 3550. For the sample data there are 24 time ranges of 3 years which sum up to over 3550. The sample data is in range A2:B73.
I'd sort the data in descending order of the Reg. date. column then it would be possible to return a result such as e.g. A5:A50 if the sum in this range is greater than 3550.
Oct 18 2023 02:19 AM
Oct 18 2023 02:48 AMSolution
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.
Oct 18 2023 03:06 AM
Oct 18 2023 03:19 AM
You are welcome. Thank you for your very interesting question.