Identifying how many days in month between 2 dates

sovereign

Board Regular
Joined
Jul 10, 2012
Messages
102
Morning,

I have been using some formula i have found on here.

Code:
=MAX(0,1+MIN(EOMONTH(F$1,0),$C2)-MAX(F$1,$B2))

But when i put it into my table it adds the numbers from the previous month:

[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]F[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD]Ref[/TD]
[TD]start[/TD]
[TD]end[/TD]
[TD]01/01/2017[/TD]
[TD]01/02/2017[/TD]
[/TR]
[TR]
[TD]548782[/TD]
[TD]04/01/2017[/TD]
[TD]05/01/2017[/TD]
[TD]2[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]563762[/TD]
[TD]24/01/2017[/TD]
[TD]06/02/2017[/TD]
[TD]8[/TD]
[TD]14[/TD]
[/TR]
</tbody>[/TABLE]


in F :
Code:
=MAX(0,1+MIN(EOMONTH(F$1,0),$C2)-MAX(F$1,$B2))
in G:
Code:
=MAX(0,1+MIN(EOMONTH(G$1,0),$C3)-MAX(G$1,$B3))

Any help please :)
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
you can use yesterday solution and just allow for months as well as per below

https://www.mrexcel.com/forum/excel-questions/1043065-formulas-help-work-out-number-days-year-our-holiday-homes-rented-out-problem-over-two-years-one-hire-s.html



<b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">C2</th><td style="text-align:left">=MAX(<font color="Blue">0,MIN(<font color="Red">1+$B2,1+EOMONTH(<font color="Green">C$1,0</font>)</font>)-MAX(<font color="Red">$A2,C$1</font>)</font>)</td></tr></tbody></table></td></tr></table><br />



Excel 2010
ABCDEFGHIJKLMN
1startend1-Jan-121-Feb-121-Mar-121-Apr-121-May-121-Jun-121-Jul-121-Aug-121-Sep-121-Oct-121-Nov-121-Dec-12
21-Feb-1215-Oct-12029313031303131301500
324-Jan-1218-Feb-128180000000000
Sheet7
 
Upvote 0
you can use yesterday solution and just allow for months as well as per below

When i put your formula into the table i still get the same result as before. for Jan it works perfect but for Feb it also seems to also count Jan Days.
 
Upvote 0
my formula is made for my table, for your table you need to adjust the references. also make sure that the dates are correct, and month and days are not inverted
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top