Need help with coverting excel if function to Javascript
I'm working on an expense form where I am having some trouble with figuring out how to code my form to correspond to the excel formulas. I want the GST in the 'Accounting Area' to calculate based on
1. If there is mileage entered above
2. if 'yes' selected in the meal/ent dropdown I want the GST to be 1/2 the actual GST amount.
I hope this makes sense?
The excel equivalent would be as below:
=IF(MEAL/ENT="Yes",1/2*GST/HST,IF(MILEAGE>=1,(TOTAL/1.05)*5%,GST/HST))
Thanks a million in advance!!
