Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 148
Default Calculate days in a given month between two dates

Hi there, I'm not quite sure if this can be done or not, but any help/advice
would be really appreciated.

I would like to work out capacity (in days) of a certain month from
different start dates and end dates. As an example below, I would like to
display for each record how many days in January are being used; so row 2
should display 26 days in January, row 3 the full 31 days in January, and row
4 should be 2 days in January.

A B
1 start end
2 14th Nov 08 26th Jan 09
3 16th Oct 08 04 Feb 09
4 30th Jan 09 10 Feb 09

Is there a formula to display this?
thanks,
Danny.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Calculate days in a given month between two dates

Hi Danny,

=MIN(B2,DATE(2009,1,31))-MAX(A2,DATE(2009,1,1))+1

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Danny" wrote in message
...
Hi there, I'm not quite sure if this can be done or not, but any
help/advice
would be really appreciated.

I would like to work out capacity (in days) of a certain month from
different start dates and end dates. As an example below, I would like to
display for each record how many days in January are being used; so row 2
should display 26 days in January, row 3 the full 31 days in January, and
row
4 should be 2 days in January.

A B
1 start end
2 14th Nov 08 26th Jan 09
3 16th Oct 08 04 Feb 09
4 30th Jan 09 10 Feb 09

Is there a formula to display this?
thanks,
Danny.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 148
Default Calculate days in a given month between two dates

That's fantastic, thank you Nick!

"Niek Otten" wrote:

Hi Danny,

=MIN(B2,DATE(2009,1,31))-MAX(A2,DATE(2009,1,1))+1

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Danny" wrote in message
...
Hi there, I'm not quite sure if this can be done or not, but any
help/advice
would be really appreciated.

I would like to work out capacity (in days) of a certain month from
different start dates and end dates. As an example below, I would like to
display for each record how many days in January are being used; so row 2
should display 26 days in January, row 3 the full 31 days in January, and
row
4 should be 2 days in January.

A B
1 start end
2 14th Nov 08 26th Jan 09
3 16th Oct 08 04 Feb 09
4 30th Jan 09 10 Feb 09

Is there a formula to display this?
thanks,
Danny.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Calculate days in a given month between two dates

--Suppose you have your data arranged in the below format. Please note that
the months displayed in cell C1 is entered in excel date formats
formatted to display as mmm-yy

Col A Col B Col C
Date In Date Out Jan-09
9-Jan-09 16-Mar-09 23

--The formula to be applied in cell C2 is given below. Copy the cells to the
right as required

=MAX(0,MIN($B2,DATE(YEAR(C$1),MONTH(C$1)+1,1))-MAX($A2+1,DATE(YEAR(C$1),MONTH(C$1),1)))

--
If this post helps click Yes
---------------
Jacob Skaria


"Danny" wrote:

Hi there, I'm not quite sure if this can be done or not, but any help/advice
would be really appreciated.

I would like to work out capacity (in days) of a certain month from
different start dates and end dates. As an example below, I would like to
display for each record how many days in January are being used; so row 2
should display 26 days in January, row 3 the full 31 days in January, and row
4 should be 2 days in January.

A B
1 start end
2 14th Nov 08 26th Jan 09
3 16th Oct 08 04 Feb 09
4 30th Jan 09 10 Feb 09

Is there a formula to display this?
thanks,
Danny.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 747
Default Calculate days in a given month between two dates

Try this

=IF(A2<DATE(2009,1,1),IF(B2DATE(2009,1,31),31,B2-DATE
(2009,1,1)+1),DATE(2009,1,31)+1-A2)



On Aug 13, 3:06*pm, Danny wrote:
Hi there, I'm not quite sure if this can be done or not, but any help/advice
would be really appreciated.

I would like to work out capacity (in days) of a certain month from
different start dates and end dates. As an example below, I would like to
display for each record how many days in January are being used; so row 2
should display 26 days in January, row 3 the full 31 days in January, and row
4 should be 2 days in January.

* * * * * A * * * * * * * * * * B
1 * start * * * * * * * * end
2 * 14th Nov 08 * * * 26th Jan 09
3 * 16th Oct 08 * * * 04 Feb 09
4 * 30th Jan 09 * * * 10 Feb 09

Is there a formula to display this?
thanks,
Danny.




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 358
Default Calculate days in a given month between two dates

What if I wanted the workin days? ie not including sat & Sun ?

Andrew

"muddan madhu" wrote:

Try this

=IF(A2<DATE(2009,1,1),IF(B2DATE(2009,1,31),31,B2-DATE
(2009,1,1)+1),DATE(2009,1,31)+1-A2)



On Aug 13, 3:06 pm, Danny wrote:
Hi there, I'm not quite sure if this can be done or not, but any help/advice
would be really appreciated.

I would like to work out capacity (in days) of a certain month from
different start dates and end dates. As an example below, I would like to
display for each record how many days in January are being used; so row 2
should display 26 days in January, row 3 the full 31 days in January, and row
4 should be 2 days in January.

A B
1 start end
2 14th Nov 08 26th Jan 09
3 16th Oct 08 04 Feb 09
4 30th Jan 09 10 Feb 09

Is there a formula to display this?
thanks,
Danny.



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Calculate days in a given month between two dates

Look at the NETWORKDAYS function (Excel help tells you how it works).
--
David Biddulph

"Andrew" wrote in message
...
What if I wanted the workin days? ie not including sat & Sun ?

Andrew

"muddan madhu" wrote:

Try this

=IF(A2<DATE(2009,1,1),IF(B2DATE(2009,1,31),31,B2-DATE
(2009,1,1)+1),DATE(2009,1,31)+1-A2)



On Aug 13, 3:06 pm, Danny wrote:
Hi there, I'm not quite sure if this can be done or not, but any
help/advice
would be really appreciated.

I would like to work out capacity (in days) of a certain month from
different start dates and end dates. As an example below, I would like
to
display for each record how many days in January are being used; so row
2
should display 26 days in January, row 3 the full 31 days in January,
and row
4 should be 2 days in January.

A B
1 start end
2 14th Nov 08 26th Jan 09
3 16th Oct 08 04 Feb 09
4 30th Jan 09 10 Feb 09

Is there a formula to display this?
thanks,
Danny.





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
CALCULATE DAYS PER MONTH BETWEEN 2 DATES wildliferehabber Excel Worksheet Functions 3 July 31st 09 06:45 AM
Calculate days in a month N Harkawat Excel Worksheet Functions 2 September 16th 08 08:46 PM
Calculate days in each month PVS Excel Worksheet Functions 8 March 27th 08 11:22 AM
How to calculate days in the month RJ Swain Excel Discussion (Misc queries) 5 February 20th 08 12:41 PM
Calculate Days in a Month LGG Excel Discussion (Misc queries) 6 January 13th 06 06:31 PM


All times are GMT +1. The time now is 12:47 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"