View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Days Calculation

On Sun, 9 Aug 2009 06:18:01 -0700, Firoz Khan
wrote:

Hi Jacob,
thanks for your reply
it seems my qstn was not clear enough
is it possible to get the result as below ?

Date In Date Out Jan Feb Mar
9-Jan-09 16-Mar-09 22 29 15
where Date In and Date Out is input data and Jan, Feb and Mar are results
is there any formula to get the days of every month for a given period of
time ?
regards
Firoz


A1: Date In
B1: Date Out
A2: 9-Jan-09
B2: 16-Mar-09

C1-N1 1-Jan-2009 1-Feb-2009 etc
Format C1-N1 as mmm yyyy

C2:
=IF($B2$A2,--TEXT(MIN($B2,EOMONTH(C$1,0))-MAX($A2,C$1-DAY(C$1)),"0;\0;\0"),"")

Fill right to N2
Fill down as far as necessary.

If you don't like seeing the 0's when there are zero days in the month, use
custom formatting to blank them out (e.g. format/cells/number/custom type: 0;;

If you get a #NAME! error, see HELP for the EOMONTH function to correct that.
If installing the ATP is not allowable, post back.

--ron