Maybe this:
Layout
[TABLE="width: 123"]
<tbody>[TR]
[TD="width: 63, bgcolor: transparent"]
From[/TD]
[TD="width: 63, bgcolor: transparent"]
To[/TD]
[TD="width: 39, bgcolor: transparent, align: right"]
abr/13[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]
01/08/2012[/TD]
[TD="bgcolor: transparent, align: right"]
31/07/2014[/TD]
[TD="bgcolor: yellow, align: right"]
30[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]
05/04/2013[/TD]
[TD="bgcolor: transparent, align: right"]
31/07/2014[/TD]
[TD="bgcolor: yellow, align: right"]
26[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]
01/08/2012[/TD]
[TD="bgcolor: transparent, align: right"]
05/04/2013[/TD]
[TD="bgcolor: yellow, align: right"]
5[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]
05/04/2013[/TD]
[TD="bgcolor: transparent, align: right"]
07/04/2013[/TD]
[TD="bgcolor: yellow, align: right"]
3[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]
01/08/2012[/TD]
[TD="bgcolor: transparent, align: right"]
07/03/2013[/TD]
[TD="bgcolor: yellow, align: right"]
0[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]
05/05/2014[/TD]
[TD="bgcolor: transparent, align: right"]
09/05/2014[/TD]
[TD="bgcolor: yellow, align: right"]
0[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]
31/03/2013[/TD]
[TD="bgcolor: transparent, align: right"]
01/05/2013[/TD]
[TD="bgcolor: yellow, align: right"]
30[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]
31/03/2013[/TD]
[TD="bgcolor: transparent, align: right"]
30/04/2013[/TD]
[TD="bgcolor: yellow, align: right"]
30[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]
01/04/2013[/TD]
[TD="bgcolor: transparent, align: right"]
01/04/2013[/TD]
[TD="bgcolor: yellow, align: right"]
1[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]
01/03/2013[/TD]
[TD="bgcolor: transparent, align: right"]
31/03/2013[/TD]
[TD="bgcolor: yellow, align: right"]
0[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]
02/03/2013[/TD]
[TD="bgcolor: transparent, align: right"]
20/04/2013[/TD]
[TD="bgcolor: yellow, align: right"]
20[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]
************[/TD]
[TD="bgcolor: transparent"]
**********[/TD]
[TD="bgcolor: transparent"]
******[/TD]
[/TR]
</tbody>[/TABLE]
Formula
Code:
In C2
=MAX(MIN($B2,EOMONTH($C$1,0))-MAX($A2,$C$1)+1,0)
Or
=MAX(MIN($B2,EOMONTH($C$1,0))-MAX($A2,$C$1-DAY($C$1)+1)+1,0)
And copy down.
Markmzz