"Data yang rapi adalah data yang bisa dipercaya. XLSX skill memastikan setiap formula jalan, setiap sel terformat, dan zero error sebelum file dideliver."
XLSX adalah skill yang aktif kapanpun spreadsheet file adalah deliverable utama. Skill ini handle segalanya mulai dari bikin financial model pro, bersihin data messy, edit file yang sudah ada, sampai convert antar format tabular.
Yang bikin skill ini special: ia memastikan setiap output punya zero formula errors β bukan cuma nulis formula sebagai teks, tapi beneran verify bahwa hasilnya benar dengan recalculation engine.
XLSX aktif otomatis ketika:
| Konteks | Contoh |
|---|---|
| Buat spreadsheet baru | "Buatin budget tracker untuk 2025" |
| Edit file yang ada | "Tambahin kolom total ke xlsx ini" |
| Bersihkan data | "File CSV ini berantakan, tolong rapiin" |
| Convert format | "Convert CSV ini ke Excel dengan formatting" |
| Financial model | "Bikin income statement model" |
| Referensi file by name | "Yang xlsx di downloads gw itu..." |
| Analisis data tabular | "Buatin pivot summary dari data ini" |
- Primary deliverable adalah Word document atau HTML report
- Bikin standalone Python script (meskipun ada tabular data)
- Google Sheets API integration
- Database pipeline
Setiap file yang dihasilkan XLSX skill harus memenuhi standar berikut sebelum dideliver:
Font Konsisten Pakai font profesional (Arial, Times New Roman) secara konsisten di seluruh file β kecuali user specify lain atau ada template yang sudah ada.
Zero Formula Errors β WAJIB Tidak ada satupun formula error yang boleh lolos:
#REF!β Invalid cell reference#DIV/0!β Division by zero#VALUE!β Wrong data type#N/Aβ Value not available#NAME?β Unrecognized formula name
Preserve Template (jika edit file existing) Saat memodifikasi file yang sudah ada: pelajari dan match persis format, style, dan konvensi yang ada. Konvensi template yang existing selalu menang atas guidelines ini.
Color Coding (Industry Standard)
| Warna | RGB | Digunakan Untuk |
|---|---|---|
| π΅ Blue text | 0, 0, 255 |
Hardcoded inputs β angka yang user akan ganti untuk skenario |
| β« Black text | 0, 0, 0 |
Semua formula dan kalkulasi |
| π’ Green text | 0, 128, 0 |
Link yang pull dari worksheet lain dalam workbook yang sama |
| π΄ Red text | 255, 0, 0 |
External links ke file lain |
| π‘ Yellow background | 255, 255, 0 |
Key assumptions yang perlu perhatian / sel yang harus diupdate |
Number Formatting Standards
| Tipe Data | Format |
|---|---|
| Tahun | Text string β "2024" bukan "2,024" |
| Currency | $#,##0 β selalu specify unit di header: "Revenue ($mm)" |
| Nol | Tampilkan sebagai - termasuk persentase: "$#,##0;($#,##0);-" |
| Persentase | 0.0% (satu desimal) |
| Valuation multiples | 0.0x β untuk EV/EBITDA, P/E, dll |
| Angka negatif | Pakai tanda kurung (123), bukan minus -123 |
Ini adalah aturan yang paling sering dilanggar. Spreadsheet harus bisa recalculate sendiri ketika data berubah.
# β SALAH β menghitung di Python lalu hardcode hasilnya
total = df['Sales'].sum()
sheet['B10'] = total # Hardcodes 5000 β gak akan update!
growth = (current - base) / base
sheet['C5'] = growth # Hardcodes 0.15 β static selamanya!
avg = sum(values) / len(values)
sheet['D20'] = avg # Hardcodes 42.5 β gak dinamis!# β
BENAR β biarkan Excel yang hitung
sheet['B10'] = '=SUM(B2:B9)' # Excel hitung sendiri
sheet['C5'] = '=(C4-C2)/C2' # Formula dinamis
sheet['D20'] = '=AVERAGE(D2:D19)' # Bisa recalculateBerlaku untuk semua kalkulasi: total, persentase, ratio, selisih, growth rate, dll.
# β SALAH β hardcode di formula
sheet['B5'] = '=B4*(1.05)' # 5% hardcoded di formula
# β
BENAR β assumptions di cell terpisah, formula pakai reference
sheet['B6'] = 0.05 # Assumption cell (colored blue)
sheet['B5'] = '=B4*(1+$B$6)' # Formula referencing assumption1. PILIH TOOL
βββ pandas β Data analysis, bulk operations, simple export
βββ openpyxl β Formula, formatting, Excel-specific features
2. CREATE / LOAD
βββ Baru β Workbook() kosong
βββ Existing β load_workbook('file.xlsx')
3. MODIFY
βββ Data, formula, formatting, sheet management
4. SAVE
βββ wb.save('output.xlsx')
5. RECALCULATE (WAJIB jika ada formula)
βββ python scripts/recalc.py output.xlsx
6. VERIFY & FIX
βββ Cek JSON output dari recalc.py
βββ Fix semua error yang ditemukan
βββ Recalculate ulang sampai status: "success"
import pandas as pd
# Baca Excel
df = pd.read_excel('file.xlsx') # Sheet pertama
all_sheets = pd.read_excel('file.xlsx', sheet_name=None) # Semua sheets
# Preview & analisis
df.head() # 5 baris pertama
df.info() # Info kolom + tipe data
df.describe() # Statistik dasar
# Tips penting
df = pd.read_excel('file.xlsx', dtype={'id': str}) # Specify tipe data
df = pd.read_excel('file.xlsx', usecols=['A', 'C', 'E']) # Kolom tertentu saja
df = pd.read_excel('file.xlsx', parse_dates=['tanggal']) # Parse date otomatis
# Tulis ke Excel
df.to_excel('output.xlsx', index=False)from openpyxl import Workbook
from openpyxl.styles import Font, PatternFill, Alignment
wb = Workbook()
sheet = wb.active
sheet.title = "Data"
# Isi data
sheet['A1'] = 'Revenue'
sheet.append(['Q1', 'Q2', 'Q3', 'Q4'])
# Formula (SELALU pakai formula, bukan hardcode!)
sheet['B10'] = '=SUM(B2:B9)'
# Formatting
sheet['A1'].font = Font(bold=True, color='000000') # Bold black
sheet['B2'].fill = PatternFill('solid', start_color='FFFF00') # Yellow bg
sheet['A1'].alignment = Alignment(horizontal='center')
# Lebar kolom
sheet.column_dimensions['A'].width = 20
wb.save('output.xlsx')from openpyxl import load_workbook
wb = load_workbook('existing.xlsx')
sheet = wb.active # Sheet aktif
sheet = wb['NamaSheet'] # Sheet by nama
# Loop semua sheets
for sheet_name in wb.sheetnames:
sheet = wb[sheet_name]
# Modifikasi
sheet['A1'] = 'Value Baru'
sheet.insert_rows(2) # Insert baris di posisi 2
sheet.delete_cols(3) # Hapus kolom 3
# Tambah sheet baru
new_sheet = wb.create_sheet('Sheet Baru')
wb.save('output_modified.xlsx')
β οΈ WARNING: Jangan buka file dengandata_only=Truelalu save ulang β semua formula akan hilang permanen dan diganti dengan values statis.
# Basic usage
python scripts/recalc.py output.xlsx
# Dengan custom timeout (detik)
python scripts/recalc.py output.xlsx 30Contoh output JSON dari recalc.py:
// β
Sukses β zero errors
{
"status": "success",
"total_errors": 0,
"total_formulas": 42
}
// β Ada errors β harus difix
{
"status": "errors_found",
"total_errors": 3,
"total_formulas": 42,
"error_summary": {
"#REF!": {
"count": 2,
"locations": ["Sheet1!B5", "Sheet1!C10"]
},
"#DIV/0!": {
"count": 1,
"locations": ["Sheet2!D15"]
}
}
}Sebelum deliver, selalu run checklist ini:
- Test 2β3 sample cell references β verify pull value yang benar sebelum build full model
- Konfirmasi column mapping Excel (kolom 64 = BL, bukan BK)
- Row offset β Excel rows itu 1-indexed (DataFrame row 5 = Excel row 6)
- NaN handling β cek null values dengan
pd.notna() - Far-right columns β FY data sering ada di kolom 50+
- Multiple matches β search semua occurrences, bukan hanya yang pertama
- Division by zero β cek denominators sebelum pakai
/dalam formula - Wrong references β verify semua cell references pointing ke cell yang tepat
- Cross-sheet references β pakai format yang benar:
Sheet1!A1
- Start small β test formula di 2β3 sel sebelum apply ke seluruh model
- Verify dependencies β semua sel yang direferensikan dalam formula harus exist
- Test edge cases β zero, negative, dan very large values
| Kebutuhan | Gunakan | Alasan |
|---|---|---|
| Analisis data, statistik | pandas | Powerful DataFrame operations |
| Bulk import/export | pandas | Cepat untuk data besar |
| Tambah formula Excel | openpyxl | pandas gak support Excel formulas |
| Format cells (color, font, border) | openpyxl | Full formatting control |
| Pivot table, chart | openpyxl | Excel-native features |
| Baca file besar (read-only) | openpyxl + read_only=True |
Memory-efficient |
| Tulis file besar | openpyxl + write_only=True |
Memory-efficient |
# Financial model dari nol
"Buatin DCF model untuk startup SaaS dengan asumsi 3-year projection"
β XLSX aktif, bikin model dengan color coding, blue inputs, black formulas,
recalculate + verify zero errors
# Bersihkan data messy
"CSV ini headernya berantakan dan ada banyak empty rows, tolong fix"
β XLSX aktif, pandas untuk cleaning, export ke .xlsx yang rapi
# Edit template existing
"Tambahin kolom YoY Growth ke laporan bulanan ini"
β XLSX aktif, preserve format existing, tambah kolom dengan formula dinamis,
recalculate untuk verify
# Convert + format
"Convert data JSON ini ke Excel dengan formatting yang proper"
β XLSX aktif, pandas untuk conversion, openpyxl untuk formatting,
deliver .xlsx yang professional
xlsx/
βββ SKILL.md β Instruksi + standar output
βββ scripts/
βββ recalc.py β Formula recalculation engine (LibreOffice-powered)
XLSX Skill β Zero formula errors. Always dynamic. Always professional.