Need to shorten the formula

neeraj_logani

New Member
Joined
Mar 25, 2021
Messages
3
Office Version
  1. 2019
Platform
  1. Windows
Hi, I have an excel file which has a formula of 2 pages. would like to check if there is a more efficient way of writing this formula



=IF($E3>EOMONTH(AD$2,0),"Agreement Not Started",IF($J3<AD$2,"Agreement Ended",
IF( $G3>EOMONTH(AD$2,--($S3=1)*-1),"Paid till "&TEXT($G3,"mmm-yy"),IF( $G3=EOMONTH(AD$2,0),"Paid start next month",
IF( AND( EOMONTH($E3,0)<AD$2, OR( AND($S3=3,MOD(MONTH(AD$2),$S3)<>1), AND($S3>=6,MOD(MONTH(AD$2),$S3)<>MOD(MONTH($E3),$S3)) ) ), "Paid "&$R3,
IF( EOMONTH($E3,0)>=AD$2,
SUM(
( $K3 / DAY(DATE($X$1,MONTH($E3)+1,0)) * (DAY(DATE($X$1,MONTH($E3)+1,0))+1-DAY($E3)) ),
( IF($S3=3, ( $K3 * DATEDIF(DATE($X$1,MONTH($E3),DAY($E3)),DATE($X$1,MROUND(MONTH($E3)+ROUNDUP($S3/2,0)-1,$S3)+1,0),"m") ), $K3 * ($S3-1) ) ),
( IF($S3=3, ( $I3 * DATEDIF(DATE($X$1,MONTH($E3),DAY($E3)),DATE($X$1,MROUND(MONTH($E3)+ROUNDUP($S3/2,0)-1,$S3)+1,0),"m") ), $I3 * $S3 ) )
),
IF( $S3=3,
IF( AND(DATE($X$1,MROUND(MONTH(AD$2)+1,3)-2,1)<=$X3,$X3<=DATE($X$1,MROUND(MONTH(AD$2)+1,3)+1,0)),
SUM(
( $Y3 * DATEDIF(AD$2,$X3,"m") ),
( $Y3 / DAY(DATE($X$1,MONTH($E3)+1,0))*(DAY($E3)-1) ),
( IF( $J3<=$X3, 0, $Z3 / DAY(DATE($X$1,MONTH($E3)+1,0))*(DAY(DATE($X$1,MONTH($E3)+1,0))+1-DAY($E3)) ) ),
( IF( $J3<=$X3, 0, $Z3 * DATEDIF(DATE($X$1,MONTH($E3),1),EDATE(AD$2,$S3-1),"m") ) ),
( $I3 * IF( $X3-1=$J3, DATEDIF(AD$2,DATE($X$1,MONTH($E3),1),"ym")+1, $S3) )
),
SUM( ($S3*$Y3), ($S3*$I3) )
),
IF( $S3=1,
SUM(
( IF( EOMONTH(AD$2,-1)<$X3, $Y3, $Z3) / DAY(EOMONTH(AD$2,-1)) * IF(AND(EOMONTH($E3,-1)+1<=EDATE(AD$2,-1),EDATE(DATE($X$1,MONTH(AD$2),DAY($E3-1)),-1)<=$J3),DAY($E3)-1,0) ),
( IF( $J3<=DATE($X$1,MONTH(AD$2),DAY($E3)), 0, IF( EOMONTH(AD$2,0)<$X3, $Y3, $Z3) / DAY(EOMONTH(AD$2,-1)) * IF(AND(EOMONTH($E3,-1)+1<=EDATE(DATE($X$1,MONTH(AD$2),DAY($E3)),-1),EOMONTH(AD$2,-1)<=$J3), DAY(EOMONTH(AD$2,-1))+1-DAY($E3), 0) ) ),
( IF( EDATE(AD$2,-1)<=$J3, $S3*$I3, $I3) )
),
SUM(
( $Y3 / DAY(EOMONTH(AD$2,0)) * IF(AND(EOMONTH($E3,-1)+1<=AD$2,DATE($X$1,MONTH(AD$2),DAY($E3-1))<=$J3),DAY($E3)-1,0) ),
( $Z3 / DAY(EOMONTH(AD$2,0)) * IF(AND(EOMONTH($E3,-1)+1<=DATE($X$1,MONTH(AD$2),DAY($E3)),EOMONTH(AD$2,0)<=$J3),DAY(EOMONTH(AD$2,0))+1-DAY($E3),0) ),
( IF( AND($S3<>1,EDATE(AD$2,1)<=$J3),$Z3*($S3-1),0) ),
( IF( EDATE(AD$2,1)<=$J3,$S3*$I3,$I3) )
)
)
)
) * (1+$P3)
)
))
))
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Instead of asking us to reverse engineer the formula, please give a description of what you want the formula to do, and what data is in each referenced cell and column.
 
Upvote 0
Instead of asking us to reverse engineer the formula, please give a description of what you want the formula to do, and what data is in each referenced cell and column.

here is the link to the file , please refer to Tab Main 2018, I am referring to data points by using multiple conditions to get status if amount is due for a month then how much. since the formula is long there are multiple points.

Any help will be appreciate
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,581
Members
449,089
Latest member
Motoracer88

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