Memuat
Memuat
Automatic Sequential IDs for neighborhood fund ledger
0 views
Every newly filled Data row automatically gets a sequential ID like INV-0001 in column H. Locking prevents duplicate numbers.

Every transaction has a tidy unique number for tracking.
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 |
|---|---|---|
| H11 | =COUNTA(Data!H2:H61) | Number of IDs issued. |
| H12 | =IF(COUNTA(Data!H2:H61)=COUNTA(Data!B2:B61),"ID lengkap","Ada baris tanpa ID") | Check every row has an ID. |
| H13 | =IFERROR(INDEX(Data!G2:G61,MATCH(Rekap!H14,Data!H2:H61,0)),"ID tidak ada") | Look up the total by the ID in H14. |
| H15 | =IF(SUMPRODUCT((Data!H2:H61<>"")/COUNTIF(Data!H2:H61,Data!H2:H61&""))=COUNTA(Data!H2:H61),"Tidak ada ID ganda","ID ganda") | Detect duplicate IDs. |
The script is delivered as a separate Code.gs file inside the ZIP. Paste it into Extensions, Apps Script. A short excerpt:
function onEdit(e) {
var sheet = e.range.getSheet();
if (sheet.getName() !== "Data") return;
var baris = e.range.getRow();
if (baris < 2) return;
var kolomId = 8;
var sel = sheet.getRange(baris, kolomId);
var item = sheet.getRange(baris, 2).getValue();
if (item === "" || sel.getValue() !== "") return;
var lock = LockService.getScriptLock();
lock.waitLock(5000);
var props = PropertiesService.getScriptProperties();
var nomor = Number(props.getProperty("nomorTerakhir") || 0) + 1;
props.setProperty("nomorTerakhir", String(nomor));
lock.releaseLock();
sheet.getRange(1, kolomId).setValue("ID");
sel.setValue("INV-" + ("0000" + nomor).slice(-4));
SpreadsheetApp.flush();
}Columns of the Data sheet:
| Cash Description | Amount |
|---|---|
| Resident Security Fee | 50,000 |
| Sanitation Fee | 25,000 |
| Social Fee | 20,000 |
| Security Guard Pay | 1,500,000 |
| Waste Collector Pay | 800,000 |
| Neighborhood Road Repair | 2,500,000 |
| Resident Meeting Snacks | 350,000 |
| Sick Resident Aid | 500,000 |
| Independence Day Contest | 3,000,000 |
| Guard Post Electricity | 150,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.
Sample data is synthetic. Google Sheets is a trademark of Google LLC.
Back to Google Sheets portfolio