I am looking for help in writing a formula that will query a table and return a sum of all dates worked within a specified month/year. My data has date ranges given with a start date in column A and an end date in column B. Many of the dates cross over multiple months. So far I have been able to successfully return the dates worked when looking at one specific row but I am drawing a blank on how to get excel to look at the whole table and sum the values.
The formula I used to return days worked within a given month/year for one specified row is:
=MAX(0,1+MIN($B2,EOMONTH(E$1&$D2,0))-MAX($A2,EOMONTH(E$1&$D2,-1)+1))
E1 is a cell with a label for January and D2 is a cell with a given year. This formula was then drug across to P2 to test if it worked for the first row of data across all months.
I need a formula that would return this same value but check the entire table's contents and sum total days.
Appreciate any help you can give.
The formula I used to return days worked within a given month/year for one specified row is:
=MAX(0,1+MIN($B2,EOMONTH(E$1&$D2,0))-MAX($A2,EOMONTH(E$1&$D2,-1)+1))
E1 is a cell with a label for January and D2 is a cell with a given year. This formula was then drug across to P2 to test if it worked for the first row of data across all months.
I need a formula that would return this same value but check the entire table's contents and sum total days.
Appreciate any help you can give.