joshbtn / excelFormulaUtilitiesJS

This library contains methods to beautify an excel formula. This library also contains functions to convert an excel formula to JavaScript (ECMAScript) or C# and python.
http://excelformulabeautifier.com/
Other
394 stars 101 forks source link

Convert to JS/C# returns nothing #61

Open waclock opened 7 years ago

waclock commented 7 years ago

Hello, I'm trying to convert the following formula to JS/C# (basically anything that's not excel), but the output doesn't work. The beautifier does work though. The formula: =IFERROR(ROUNDDOWN(IF(IFERROR(IF(AH6="N",IF(AJ6=0,0,BN6*AK6/AJ6),IF(AG6=0,IF(AJ6=0,0,BN6*AK6/AJ6),IF(AG6=100%,0,(1+$CI$4)*BN6*(1-$AH6)/(1-$AG6)))),"")>1,IFERROR(IF(AH6="N",IF(AJ6=0,0,BN6*AK6/AJ6),IF(AG6=0,IF(AJ6=0,0,BN6*AK6/AJ6),IF(AG6=100%,0,(1+$CI$4)*BN6*(1-$AH6)/(1-$AG6)))),""),IFERROR(VLOOKUP(A6,Sheet2!A:B,2,0),"")),0),"")

joshbtn commented 7 years ago

Thanks for reporting this! Nothing is jumping out at me as to what's going wrong but I will dive into this as time allows.

Jefwillems commented 7 years ago

same problem here. beautifier works, but convert to javascript/c# and python does not.

formula is:

IF(C7<C8;"Opgelet aantal km per rit is hoger dan totaal aantal km per jaar";IF(AND(C4="LCV";OR(C5="CNG";C5="Waterstofgas";C5="Elektriciteit"));"Brandstof- en voertuigtype match is onwaarschijnlijk";IF(((C10÷(C7÷C8)÷C9))≥12;IF(AND(C4="LCV";((C10÷(C7÷C8)÷C9))≤30);"consistent";"Gemiddelde tonnage per rit vereist een ander voertuigtype:");IF(C4="SCV/MCV";"consistent";"Gemiddelde tonnage per rit vereist een ander voertuigtype:"))))

micahcain commented 6 years ago

Same problem. Would really like to see a fix for this.

joshbtn commented 6 years ago

Thanks for the feedback all, I've been away from this project for a while so I'm re-orienting my self but I'll tackle this bug next

joereddington commented 5 years ago

Had this issue today, with the input:

{=IFERROR(INDEX('All spending'!$C$2:$C$9929,SMALL(IF('All spending'!$H$2:$H$9929=$C$17,ROW('All spending'!$A$2:$A$9929)),ROW(1:1))),"")}

Beutify works fine, translate doesn't :(