Excel calculates payroll instances by title

Source: Internet
Author: User

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).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.