admin管理员组文章数量:1429014
I have the formula in the excel sheet like
=IF($F6=0,"",IF(I6=0,"",$F6/I6))
where F6=7000; I6="";
The excel result is showing no data for the Formula, now in javascript I need to convert.
function AB6(F6)
{
var AB6="";
if(F6==0)
AB6='data';
alert("Data: "+AB6);
if(I6==0)
{
AB6="";
AB6=F6/I6;
alert(AB6);
}
return AB6;
}
is this a right function in javascript for the below formula.
I have the formula in the excel sheet like
=IF($F6=0,"",IF(I6=0,"",$F6/I6))
where F6=7000; I6="";
The excel result is showing no data for the Formula, now in javascript I need to convert.
function AB6(F6)
{
var AB6="";
if(F6==0)
AB6='data';
alert("Data: "+AB6);
if(I6==0)
{
AB6="";
AB6=F6/I6;
alert(AB6);
}
return AB6;
}
is this a right function in javascript for the below formula.
Share Improve this question asked Oct 23, 2013 at 11:43 NavyahNavyah 1,68011 gold badges33 silver badges59 bronze badges 3- 1 Please don't write in ALL CAPS, it's hard to read. – user9876 Commented Oct 23, 2013 at 11:45
- 1 there are lot of converters available. Make use of them.excelformulabeautifier. – The Hungry Dictator Commented Oct 23, 2013 at 11:48
- I dont want a conevrt if just giving if condition, i want result for that if condition – Navyah Commented Oct 23, 2013 at 11:58
1 Answer
Reset to default 2No. The I6 parison in excel is only executed when the F6 parison failed. Even more, there is never an else
part in your javascript...
This is the javascript equivalent:
if (F6 == 0) {
AB6="";
} else {
if (I6 == 0) {
AB6 = "";
} else {
AB6 = F6/I6;
}
}
本文标签: How to convert the Excel formula into javascriptStack Overflow
版权声明:本文标题:How to convert the Excel formula into javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745457471a2659170.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论