Counting Specific Number of Days across Multiple Months
With this structure...
A1: (a start date)
B1: (an end date)
These cells contain text
C1: JAN
D1: FEB
etc
N1: DEC
Try something like this:
C2: =SUMPRODUCT(--(TEXT(ROW(INDEX($A:$A,$A$1):INDEX($A:$A,$B$1)),"MM M")=C1))
Copy C2 across through N2
Note: if you want to account for Montth/Year combinations, let us know.
Is that something you can work with?
***********
Regards,
Ron
XL2002, WinXP
"cardan" wrote:
I have a task which seems relatively easy at first. I have two dates
as inputs: a start date and a stop date that can vary between dates
and lenght of time. I have a header row with dates by month. I am
trying to write a formula that will tell me how many days between the
start and stop date are in each month. For example, if I start on Jan
30 and end on Feb 2nd of the same year, I will show 2 under the Jan
header and 2 under the Feb header. Sometimes it will go on for a
couple months, so if it is a complete months, say starts on Jan 30th
and Ends on Mar 2, I will need it say 2 under Jan, 28 under Feb, and
2
under March. I have tried to Dateif, but not sure if I am looking at
it correctly? Any suggestions would be most helpful. Thank you in
advance! (This message was previously posted in
microsoft.public.excel.links)
|