[Transfer from csdn] Excel payroll Printing

Source: Internet
Author: User

Original post: http://community.csdn.net/Expert/topic/5000/5000593.xml

Q: taoyb (tyb)
If a wage data table is printed, A4 paper is used. The header must be added to each row of data, such as employee ID, name, and salary.
This information is available in the first line. How can we put the information in the first line on each line?

A:Yiqun_zhao (lanfan Yu Xuan yiqun.zhao.msmvp@gmail.com)
Assume that the row of the original salary title is in the first row and starts from the second row as data, as shown in the following example:
A B C
1 employee's attendance salary
2 1 21 8430
3 2 21 4690
4 3 20 7545
5 4 21 6680
6 5 21 2190

Assume that our formula starts from D1 (the formula for E1 and F1 is the same, and can be copied from D1). The formula is as follows:
= Indirect (if (mod (row (), 2) = 1, address (mod (row (), 2), column ()-3), address (row () /2 + 1, column ()-3 )))

You can copy the formula to the corresponding area of columns D, E, and F. The result is as follows:
A B C D E F
1. employee ID: Attendance salary
2 1 21 8430 1 21 8430
3 2 21 4690 employee ID attendance salary
4 3 20 7545 2 21 4690
5 4 21 6680 employee ID attendance salary
6 5 21 2190 3 20 7545
Employee ID attendance salary
4 21 6680
Employee ID attendance salary
5 21 2190

You can see that columns D, E, and F have been generated based on the source data of columns A, B, and C.

Note: column ()-3 in the formula indicates the relative position to the right of the three columns. You need to change the corresponding relative position as the worksheet/relative position is different.

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.