Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

100
Views
Is there any problem with converting this excel formula to javascript?

Here is the excel formula:

=E2-(J2*2*G2)-(K2*E2*2)/30+IF((L2+M2)>60,((L2+M2)-60)*H2+60*G2,(L2+M2)*G2)+(N2/$AE$1)*$AE$2+(Q2*$AE$5+P2*$AE$4+O2*$AE$3)

Here what I tried (Javascript):

                    var E2 = $("#sentence").val();
                    var J2 = $("#deduction").val();
                    var G2 = 55145;
                    var K2 = $("#absence").val();
                    var L2 = $("#overtime").val();
                    var M2 = 0;
                    var H2 = 50050;
                    var N2 = $("#transportation").val();
                    var sixty;

                if ((L2 + M2) > 60) {
                    sixty = ((L2 + M2) - 60) * H2 + 60 * G2;
                } else {
                    sixty = (L2 + M2) * G2;
                };

                var result = E2 - (J2 * 2 * G2) - (K2 * E2 * 2) / 30 + sixty;

I couldn't find the way to conver this part of formula:

+(N2/$AE$1)*$AE$2+(Q2*$AE$5+P2*$AE$4+O2*$AE$3)

Here I found the problem:

Even if one of the variables sets to null, then the formula does not work properly.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It looks like some pretty basic math.

let total = (N2 / AE1) * AE2 + (Q2 * AE5 + P2 * AE4 + O2 * AE3 )

This is basically impossible to translate without seeing the actual spreadsheet but that should get you started. Also, make sure to take into consideration order of operations because the computer is going to evaluate it from left to right unless there are parenthesis (where it will evaluate those first).

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!