Imran Azam
Board Regular
- Joined
- Mar 15, 2011
- Messages
- 103
Hi Guys
can anyone explain to me what this formula is doing?
the formula: =IF(AND($C2=1,G2<>0),0,IF(AND($C2=1,MONTH($B2)&YEAR($B2)=MONTH(H$1)&YEAR(H$1)),$F2,IF(MONTH($A2)&YEAR($A2)=MONTH(H$1)&YEAR(H$1),$F2,IF(AND(RIGHT(H$1,4)&MID(H$1,4,2)&LEFT(H$1,2)>TEXT($D2,"YYYYMMDD"),RIGHT(H$1,4)&MID(H$1,4,2)&LEFT(H$1,2)<= TEXT($E2,"YYYYMMDD")),$F2,0))))
data below
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Start Date[/TD]
[TD]END DATE[/TD]
[TD]LENTH[/TD]
[TD]first date of Start[/TD]
[TD]first date of END[/TD]
[TD] per mth[/TD]
[TD]30/06/2016[/TD]
[TD]31/07/2016[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]13/08/2015[/TD]
[TD]12/08/2016[/TD]
[TD]12[/TD]
[TD]01/08/2015[/TD]
[TD]31/07/2016[/TD]
[TD]133.33[/TD]
[TD]1466.63[/TD]
[TD]133[/TD]
[/TR]
</tbody>[/TABLE]
the formula is typed in column H2 ( the output is 133 )
thank you for any help provided.
can anyone explain to me what this formula is doing?
the formula: =IF(AND($C2=1,G2<>0),0,IF(AND($C2=1,MONTH($B2)&YEAR($B2)=MONTH(H$1)&YEAR(H$1)),$F2,IF(MONTH($A2)&YEAR($A2)=MONTH(H$1)&YEAR(H$1),$F2,IF(AND(RIGHT(H$1,4)&MID(H$1,4,2)&LEFT(H$1,2)>TEXT($D2,"YYYYMMDD"),RIGHT(H$1,4)&MID(H$1,4,2)&LEFT(H$1,2)<= TEXT($E2,"YYYYMMDD")),$F2,0))))
data below
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Start Date[/TD]
[TD]END DATE[/TD]
[TD]LENTH[/TD]
[TD]first date of Start[/TD]
[TD]first date of END[/TD]
[TD] per mth[/TD]
[TD]30/06/2016[/TD]
[TD]31/07/2016[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]13/08/2015[/TD]
[TD]12/08/2016[/TD]
[TD]12[/TD]
[TD]01/08/2015[/TD]
[TD]31/07/2016[/TD]
[TD]133.33[/TD]
[TD]1466.63[/TD]
[TD]133[/TD]
[/TR]
</tbody>[/TABLE]
the formula is typed in column H2 ( the output is 133 )
thank you for any help provided.