Current location - Quotes Website - Signature design - How is the payslip printed?
How is the payslip printed?

1. Create a new Excel file and store the original data of the salary table in sheet1. Assume there are N columns. The first line is the salary item, and starting from the second line is everyone's salary.

2. In sheet2, we set up the salary slip. According to the actual situation, the salary slip consists of three lines, one line corresponding to the salary item, one line corresponding to the salary data of a person, and then a blank line for easy cutting. These three lines form a payslip. The salary item is on the line where the line number is divided by 3 and the remainder is 1; the blank line is on the line where the line number can be divided evenly by 3. The above two lines are not difficult to set up. The key is the salary data line, which involves the correspondence between the data in sheet1 and sheet2. After analysis, it is not difficult to see that "data line in sheet1 = INT ((data line in sheet2 + 4)/3)" ".

3. In this way, we enter the formula "=IF(MOD(ROW(),3)=0,"",IF(MOD(ROW(),3)=1 in cell A1 of sheet2 ,Sheet1!A$1,INDEX(Sheet1!$A:$N,INT((ROW()+4)/3),COLUMN())))”. After confirmation, select cell A1, place the mouse in the lower right corner of cell A1, and when the mouse turns into "+", drag the mouse to the right to automatically fill in column N, so that the first row in the salary slip will appear. Select A1:N1, put the mouse in the lower right corner of cell N1, when the mouse changes to "+" again, drag the mouse downward to automatically fill in the last row of data, and the salary slip is completed.

Remember the formula "=IF(MOD(ROW(),3)=0,"",IF(MOD(ROW(),3)=1,Sheet1!A$1,INDEX(Sheet1!$ A:$N,INT((ROW()+4)/3),COLUMN())))” You need to remove the quotation marks at both ends.

See the picture for the finished effect