The employee's salary is to be adjusted this month, and the manager demands a salary increase according to each person's title. Specific requirements: The primary title for the beginning of this month plus 20 Yuan, the title for the middle of this month plus 50 yuan, the title of the senior 70 yuan this month. But because the company has too many people, adding one by one is not only troublesome but also error prone.
After some groping, I found two ways to efficiently solve the problem of Excek by professional title.
Method one: Using conditional function if
Step One: Open the payroll and enter =if (b2= "Elementary", G2+20,if (b2= "Intermediate", G2+50,if (b2= "Advanced"), g2+70) below the actual payroll.
Note: (B2 representative title; G2 on behalf of pay, figure 1).
The second step: Enter, fast down to fill.
Method Two: Using the Visual Basic Editor
The first step: tools → macros →visual basic Editor.
Step two: On the sheet!, right click → insert → module.
Step Three: Enter the following code
The following is a reference fragment:
Function SSS (TATOL, SS)
If SS = "PRIMARY" Then
SSS = tatol+20
ElseIf SS = "Intermediate" Then
SSS = tatol+50
ElseIf SS = "Advanced" Then
SSS = tatol+70
End If
End Function
Note: Code explanation: SSS representative of the number of letters, TATOL on behalf of real wages, SS representatives should be paid.
Fourth step: Close the Visual Basic Editor → Enter =sss (g2,b2) → Return to fill down in the actual payroll (Figure 2).