Hi Community,
I have a cruddy report that cannot give me the data i need which forces me to calculate the number of days a person has been helping our organization and I was hoping there might be a formula that can help automate the calculation a bit, but I cannot wrap my head around it (terrible with IF formulas). The report is run once per month and will produce 4 different combinations of dates for the in and out field.
Combination 1, OUT date is prior to the start of the month, and IN date is after the last date of the reporting month OR blank . This calculation would then be the same as the number of days in the month. Example for May (OUT is 4/20/21 and IN is 6/5/21 or blank, would = 31 days)
Combination 2, OUT date is prior to the start of the month, and IN date is within the month of reporting. This calculation would be the datediff between the IN date and the last day of the previous month. Example would be (OUT 4/20/21, IN 5/14/21= 14 days)
Combination 3, OUT date begins within the reporting month and IN date is the next month OR blank. Calculation would be the datediff between the OUT date and the 1st of the next month. Example (OUT is 5/14/21 and IN is within the next month OR blank= 17 days)
Combination 4, OUT date begins within the reporting month and IN date is also within the reporting month. Calculation would be the date difference between both dates. (OUT is 5/1/21 and IN is 5/14/21 = 13 days)
Some date examples from my table below:
I appreciate any help (if possible) the community could provide.