Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rewrite excel formulas in a readable manner?

I have an Excel file with formulas in this manner:

=IF(OR(ISERROR(G16),ISERROR(G17)),X16,IF(OR(G16="xxx",G16="yyy",G16="zzz"),Y16,IF(G16="333","N\A",IF(G17="333",Z16,IF(D17="",IF((HEX2DEC(W$10)-HEX2DEC(W16))/VLOOKUP(F16,$M$36:$N$41,2,FALSE)<0,0,(HEX2DEC(W$10)-HEX2DEC(W16))/VLOOKUP(F16,$M$36:$N$41,2,FALSE)), IF((HEX2DEC(W17)-HEX2DEC(W16))/VLOOKUP(F16,$M$36:$N$41,2,FALSE)<0,0,(HEX2DEC(W17)-HEX2DEC(W16))/VLOOKUP(F16,$M$36:$N$41,2,FALSE)))))))

I would like to simplify them so it will be written in a more readable manner.

  • Can I edit/write Excel formulas in indented way?
  • What kind of simplifications can I do?
  • Should I use an VBA script instead of Excel's formulas?
like image 616
0x90 Avatar asked Oct 03 '12 17:10

0x90


People also ask

How do I make an Excel formula more readable?

By adding white space to the formula, we can expose this pattern visually. To do this with a nested IF, first expand the formula bar. We need to be able to see more than one line. Then, click into the first IF statement and use the tip window to select the value if true.

How do I convert a formula to normal text in Excel?

To copy the actual value instead of the formula from the cell to another worksheet or workbook, you can convert the formula in its cell to its value by doing the following: Press F2 to edit the cell. Press F9, and then press ENTER.

How do you display and edit formulas?

In your Excel worksheet, go to the Formulas tab > Formula Auditing group and click the Show Formulas button. Microsoft Excel displays formulas in cells instead of their results right away. To get the calculated values back, click the Show Formulas button again to toggle it off.


1 Answers

You can use Alt+Enter in the formula bar to make your formula multiline. Sadly, no tabs only spaces so it becomes tedious to create and edit. See also

http://www.dailydoseofexcel.com/archives/2005/04/01/excel-formula-formatter/

like image 131
Dick Kusleika Avatar answered Sep 19 '22 22:09

Dick Kusleika