How To Tidy Up Your Formula On Excel - Save My Knowledge
Wednesday, October 1, 2014

How To Tidy Up Your Formula On Excel

Hi, do you ever work with super long formula on excel and it make your head hurt just to see your formula alone?
Yeah, I ever see formula of my friend and just watch it alone, it can make my head hurts.
But I have the solution of that problem, this solution can make you see the formula easier than before and if you are a mathematical and need to create formula that long, it can be helpful to you.

The key is you need to press [ALT] + [Enter] between the code
This example show you that I have formula and even though it didn't that long. But it still pretty annoying if you focused on another field and then read this formula again

"=IF($A1=0,0,IF($B1<4264,0,IF(AND($B1>=4264,$B1<=4895),(-22.31*$C1/365),IF(AND($B1>=4895,$B1<=32760),($B1*0.093-476.89)*$C1/365,IF($B1>32760,($B1*0.128-1623.49)*$C1/365)))))"


With [ALT] + [Enter], you can separate it to be like this

"=IF($A1=0,0,
IF($B1<4264,0,
IF(AND($B1>=4264,$B1<=4895),(-22.31*$C1/365),
IF(AND($B1>=4895,$B1<=32760),($B1*0.093-476.89)*$C1/365,
IF($B1>32760,($B1*0.128-1623.49)*$C1/365)))))"


It become 5 line but it better than before.
Do you agree with me?