Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
STFC
 
Posts: n/a
Default Calculating days in a month

Hello,

Hope someone can help.

A1 = Start date B1=End Date eg A1 = 1st Jan B1=4th April

C1=Days in Jan D1=Days in Feb E1=Days in Mar etc until Dec.

Therefore for the above example C1 would = 31days D1 = 28days E1 = 31days
and F1 = 4 days.

I have been playing around with IF and DATEDIF but I'm getting nowhere. Any
help would be much appreciated.
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

C1: =DAY(DATE(YEAR(A1),MONTH(A1)+1,0))
D1: =DAY(DATE(YEAR(A1),MONTH(A1)+2,0))
E1: =DAY(DATE(YEAR(A1),MONTH(A1)+3,0))
--

HTH

RP
(remove nothere from the email address if mailing direct)


"STFC" wrote in message
...
Hello,

Hope someone can help.

A1 = Start date B1=End Date eg A1 = 1st Jan B1=4th April

C1=Days in Jan D1=Days in Feb E1=Days in Mar etc until Dec.

Therefore for the above example C1 would = 31days D1 = 28days E1 = 31days
and F1 = 4 days.

I have been playing around with IF and DATEDIF but I'm getting nowhere.

Any
help would be much appreciated.



  #3   Report Post  
STFC
 
Posts: n/a
Default

Hi Bob

Wow, thanks for the quick response.

I was really after a formaula that would take into account partial months.

Therefore if Start Date = 15 Jan, End Date= 4th Apr

Jan=17 days, Feb=28days Mar= 31day and Apr=4 days, May=0, Jun=0 etc. This is
for when campaigns ran in a year, and which months it ran in.

Andy.



"Bob Phillips" wrote:

C1: =DAY(DATE(YEAR(A1),MONTH(A1)+1,0))
D1: =DAY(DATE(YEAR(A1),MONTH(A1)+2,0))
E1: =DAY(DATE(YEAR(A1),MONTH(A1)+3,0))
--

HTH

RP
(remove nothere from the email address if mailing direct)


"STFC" wrote in message
...
Hello,

Hope someone can help.

A1 = Start date B1=End Date eg A1 = 1st Jan B1=4th April

C1=Days in Jan D1=Days in Feb E1=Days in Mar etc until Dec.

Therefore for the above example C1 would = 31days D1 = 28days E1 = 31days
and F1 = 4 days.

I have been playing around with IF and DATEDIF but I'm getting nowhere.

Any
help would be much appreciated.




  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Are you looking for a more variable formula, or will the start and end dates
always span 4 months?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"STFC" wrote in message
...
Hi Bob

Wow, thanks for the quick response.

I was really after a formaula that would take into account partial months.

Therefore if Start Date = 15 Jan, End Date= 4th Apr

Jan=17 days, Feb=28days Mar= 31day and Apr=4 days, May=0, Jun=0 etc. This

is
for when campaigns ran in a year, and which months it ran in.

Andy.



"Bob Phillips" wrote:

C1: =DAY(DATE(YEAR(A1),MONTH(A1)+1,0))
D1: =DAY(DATE(YEAR(A1),MONTH(A1)+2,0))
E1: =DAY(DATE(YEAR(A1),MONTH(A1)+3,0))
--

HTH

RP
(remove nothere from the email address if mailing direct)


"STFC" wrote in message
...
Hello,

Hope someone can help.

A1 = Start date B1=End Date eg A1 = 1st Jan B1=4th April

C1=Days in Jan D1=Days in Feb E1=Days in Mar etc until Dec.

Therefore for the above example C1 would = 31days D1 = 28days E1 =

31days
and F1 = 4 days.

I have been playing around with IF and DATEDIF but I'm getting

nowhere.
Any
help would be much appreciated.






  #5   Report Post  
STFC
 
Posts: n/a
Default

Sorry I haven't been that clear have I.

Yes a more variable formula - the campaigns can run for anything from a week
to a year.

"Bob Phillips" wrote:

Are you looking for a more variable formula, or will the start and end dates
always span 4 months?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"STFC" wrote in message
...
Hi Bob

Wow, thanks for the quick response.

I was really after a formaula that would take into account partial months.

Therefore if Start Date = 15 Jan, End Date= 4th Apr

Jan=17 days, Feb=28days Mar= 31day and Apr=4 days, May=0, Jun=0 etc. This

is
for when campaigns ran in a year, and which months it ran in.

Andy.



"Bob Phillips" wrote:

C1: =DAY(DATE(YEAR(A1),MONTH(A1)+1,0))
D1: =DAY(DATE(YEAR(A1),MONTH(A1)+2,0))
E1: =DAY(DATE(YEAR(A1),MONTH(A1)+3,0))
--

HTH

RP
(remove nothere from the email address if mailing direct)


"STFC" wrote in message
...
Hello,

Hope someone can help.

A1 = Start date B1=End Date eg A1 = 1st Jan B1=4th April

C1=Days in Jan D1=Days in Feb E1=Days in Mar etc until Dec.

Therefore for the above example C1 would = 31days D1 = 28days E1 =

31days
and F1 = 4 days.

I have been playing around with IF and DATEDIF but I'm getting

nowhere.
Any
help would be much appreciated.








  #6   Report Post  
Bob Phillips
 
Posts: n/a
Default

Okay, another shot.

Assuming that the start date is in A1, end date is in B1, and the campaign
days are in C1:C12

In C1: =DATE(YEAR(A$1),MONTH(A$1)+1,1)-A1
Select all C2:C11 cells together, then enter this array formula into the
formula bar (commit with Ctrlo-Shift-Enter)
=IF(ROW(INDIRECT("2:100"))=MONTH($B$1),DAY($B$1),D AY(DATE(YEAR(A$1),MONTH(A$
1)+ROW(INDIRECT("2:100")),0))*(MONTH($B$1)=ROW(IN DIRECT("2:100"))))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"STFC" wrote in message
...
Sorry I haven't been that clear have I.

Yes a more variable formula - the campaigns can run for anything from a

week
to a year.

"Bob Phillips" wrote:

Are you looking for a more variable formula, or will the start and end

dates
always span 4 months?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"STFC" wrote in message
...
Hi Bob

Wow, thanks for the quick response.

I was really after a formaula that would take into account partial

months.

Therefore if Start Date = 15 Jan, End Date= 4th Apr

Jan=17 days, Feb=28days Mar= 31day and Apr=4 days, May=0, Jun=0 etc.

This
is
for when campaigns ran in a year, and which months it ran in.

Andy.



"Bob Phillips" wrote:

C1: =DAY(DATE(YEAR(A1),MONTH(A1)+1,0))
D1: =DAY(DATE(YEAR(A1),MONTH(A1)+2,0))
E1: =DAY(DATE(YEAR(A1),MONTH(A1)+3,0))
--

HTH

RP
(remove nothere from the email address if mailing direct)


"STFC" wrote in message
...
Hello,

Hope someone can help.

A1 = Start date B1=End Date eg A1 = 1st Jan B1=4th April

C1=Days in Jan D1=Days in Feb E1=Days in Mar etc until Dec.

Therefore for the above example C1 would = 31days D1 = 28days E1 =

31days
and F1 = 4 days.

I have been playing around with IF and DATEDIF but I'm getting

nowhere.
Any
help would be much appreciated.








  #7   Report Post  
Stefi
 
Posts: n/a
Default

Format Cell C1 as dd and the formula: =EOMONTH(A1;0)

Stefi


STFC ezt *rta:

Hello,

Hope someone can help.

A1 = Start date B1=End Date eg A1 = 1st Jan B1=4th April

C1=Days in Jan D1=Days in Feb E1=Days in Mar etc until Dec.

Therefore for the above example C1 would = 31days D1 = 28days E1 = 31days
and F1 = 4 days.

I have been playing around with IF and DATEDIF but I'm getting nowhere. Any
help would be much appreciated.

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
Summarizing of columns for different days of month Charles Excel Discussion (Misc queries) 4 January 18th 05 04:07 PM
Calculating interest on number of days in the period Ron Excel Worksheet Functions 0 January 18th 05 12:59 AM
Calculating Production/Man Days in Excel mpetersen Excel Discussion (Misc queries) 3 December 16th 04 02:41 PM
Help! I am stuck calculating Days, Hours, Mins please help OB1 Excel Worksheet Functions 3 November 15th 04 05:17 PM
How to Set a fix # of days per month iboock Excel Worksheet Functions 0 November 3rd 04 06:53 AM


All times are GMT +1. The time now is 05:55 PM.

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

About Us

"It's about Microsoft Excel"