Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.links
external usenet poster
 
Posts: 2
Default Counting Specific Number of Days across Multiple Months

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!

  #2   Report Post  
Posted to microsoft.public.excel.links
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Counting Specific Number of Days across Multiple Months

One approach to achieve it is illustrated in this sample construct:
http://www.savefile.com/files/638369
Apportioning days within a date range under correct month cols.xls

Startdates in E3 down, Enddates in F3 down
1st of month dates (formatted as "mmm-yy") listed in L2 across, viz: Jan-07,
Feb-07, etc

Then in L3:
=IF(TEXT(L$2,"mmm-yy")=TEXT($E3,"mmm-yy"),DATE(YEAR(L$2),MONTH(L$2)+1,0)-$E3+1,IF(TEXT(L$2,"mmm-yy")=TEXT($F3,"mmm-yy"),$F3-DATE(YEAR(L$2),MONTH(L$2),1)+1,IF(AND(DATE(YEAR(L$ 2),MONTH(L$2),1)DATE(YEAR($E3),MONTH($E3),1),DATE (YEAR(L$2),MONTH(L$2),1)<DATE(YEAR($F3),MONTH($F3) ,1)),DAY(DATE(YEAR(L$2),MONTH(L$2)+1,0)),"")))

Copy L3 across/fill down as far as required. This will return the number of
days under each month's col as appropriate (between the startdates and
enddates in cols E and F)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
wrote in message
ps.com...
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!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Number of Months and Days between 2 dates? Jean Excel Worksheet Functions 3 March 30th 07 04:49 PM
Number of years/months/days between 2 dates Deborah Excel Worksheet Functions 4 July 7th 06 11:24 AM
how do I convert a number to number of years, months and days because Excel Worksheet Functions 2 October 12th 05 06:15 PM
Number of years, months, days between two dates. Bluenose Excel Worksheet Functions 34 June 30th 05 02:18 PM
Converting number of days to years and months Dave Cobb Excel Worksheet Functions 4 May 24th 05 09:14 PM


All times are GMT +1. The time now is 04:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"