dimanche 11 août 2019

Loop if else statement [on hold]

I have a excel file with the columns Name, Emp Id, Age, Department Salary.

I want to use a for loop statement and show in a new column called bonus that, if the salary is greater than 1000 but less than 2000 and department is Hr, then bonus should be 250, else if the salary is greater than 2000 but less than 3000 and department is MR, then bonus should be 350, else return 500.

For more clarity, below are the conditions:

if salary > 1000 and salary < 2000 and department ==  'HR'
then
bonus should be 250 
elseif 
salary  > 2000 and salary  < 3000 and department == 'MR' 
then 
bonus should be 350 
else 
return 500

Aucun commentaire:

Enregistrer un commentaire