# Long IF Function help

#### DanielWeiss11230

##### New member
So I want to figure this out in google sheets.
I have 4 employees. They all make a different commission on a sale.
Employee number 1 (with lets say the initials "CM") makes \$50 on a sale.
Employee number 2 (initials "MB" makes 20% on a sale)
Employee number 3 (initials "AR" makes 10% if less than \$1200, 15% if \$1200 or greater)
Employee number 4 (initials "LE" makes 10% if less than \$1200, 15% if \$1200 or greater [same as employee AR])

In google sheets, Column A has the gross sales,Column B has the initials of the employee and the 3rd column is the comission given to said employee. The code I came up with was the following:

=IF(B1="cm",50,IF(B1="mb",A1*20%, IF(B1="ar", IF(A1<1200,A1*10%, IF(B1="ar", IF(A1>=1200,A1*15%, IF(B1="le", IF(A1<1200,A1*10%,IF(B1="le",IF(A1>=1200, A1*15%))))))))))

The code works for all employees but fails on LE which is the last employee in the code. The result given is "FALSE", what am I doing wrong?

#### Bob Phillips

##### Super Moderator
Staff member
This is an Excel forum not Google docs, this works in Excel, no idea about Google docs

=IF(B1="cm",50,IF(B1="mb",A1*20%,IF(OR(B1="ar",B1="le"),IF(A1<1200,A1*10%,A1*15%),"Invalid name")))