Memuat
Memuat
Automatic Monthly Summary for employee attendance and payroll
0 views
The script groups Data by month and writes a month, qty, and total table into the Rekap sheet. It can be scheduled at every month start.

Sample data is synthetic. Google Sheets is a trademark of Google LLC.
The monthly table builds itself and is ready for charts.
The real project file is available. It is not just the picture above: you get the working file with every formula in place. It can be downloaded after payment, and we send the download link by WhatsApp or email.
ZIP: .xlsx workbook + Apps Script module (.zip)
| Cell | Formula | What it does |
|---|---|---|
| N2 | =SUM(L2:L100) | Total of all months. |
| N3 | =SUM(Data!G2:G61)-N2 | Difference against Data, should be zero. |
| N4 | =MAX(L2:L100) | Highest monthly total. |
| N5 | =IFERROR(INDEX(J2:J100,MATCH(N4,L2:L100,0)),"") | Name of the best month. |
The script is delivered as a separate Code.gs file inside the ZIP. Paste it into Extensions, Apps Script. A short excerpt:
function rekapBulanan() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var data = ss.getSheetByName("Data").getDataRange().getValues();
var rekap = ss.getSheetByName("Rekap");
var hasil = {};
for (var i = 1; i < data.length; i++) {
if (!data[i][0]) continue;
var tgl = new Date(data[i][0]);
var kunci = Utilities.formatDate(tgl, "Asia/Jakarta", "yyyy-MM");
if (!hasil[kunci]) hasil[kunci] = { qty: 0, total: 0 };
hasil[kunci].qty += Number(data[i][3]) || 0;
hasil[kunci].total += Number(data[i][6]) || 0;
}
var baris = [["Bulan", "Qty", "Total"]];
Object.keys(hasil).sort().forEach(function (k) {
baris.push([k, hasil[k].qty, hasil[k].total]);
});
rekap.getRange("J1:L100").clearContent();
rekap.getRange(1, 10, baris.length, 3).setValues(baris);
}Columns of the Data sheet:
| Pay Component | Amount |
|---|---|
| Staff Base Salary | 4,500,000 |
| Supervisor Base Salary | 6,500,000 |
| Transport Allowance | 300,000 |
| Daily Meal Allowance | 25,000 |
| Overtime per Hour | 30,000 |
| Target Bonus | 750,000 |
| BPJS Health Contribution | 120,000 |
| BPJS Employment Contribution | 95,000 |
| Late Deduction | 20,000 |
| Holiday Allowance | 3,000,000 |
The sample data is synthetic.
Yes. The picture above is only a preview. After payment we send the download link of the real project file (a ZIP containing the .xlsx workbook and the macro module) by WhatsApp or email.
No. The sample data is synthetic and only shows how the formulas behave. Replace it with your own data and the formulas keep working.
Yes, as a separate order. Message us on WhatsApp with a short description of your columns and what you want to see.