A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
For the monthly sheet and weekly sheet, use formulas that count each attendance code and then multiply by the correct daily rate. The context only provides general Excel guidance, so only a pattern can be given, not exact cell addresses for every column.
1. Monthly attendance – salary in AJ
Assumptions (adapt as needed):
- Column C = Monthly salary.
- Row 3 = first employee.
- Attendance for the month is in E3:AI3.
- Codes:
P= full day present,A= absent,0.5P(orP0.5) = half day present. - Column D holds the number of paid leave days (already allowed and not to be deducted).
Steps:
- Compute the number of working days in the row (present + half‑day + absent):
=COUNTA(E3:AI3) - Compute present days (full + half):
(Change the text in the second=COUNTIF(E3:AI3,"P") + 0.5*COUNTIF(E3:AI3,"0.5P")COUNTIFto whatever is actually used for half day.) - Daily rate from monthly salary:
=C3 / (COUNTA(E3:AI3)) - Salary to be paid in AJ3 (including paid leaves in D3, excluding unpaid absences):
= (C3 / COUNTA(E3:AI3)) * ( COUNTIF(E3:AI3,"P") + 0.5*COUNTIF(E3:AI3,"0.5P") + D3 )
Copy AJ3 down for all employees.
This formula:
- Divides monthly salary by the number of working days to get a per‑day rate.
- Multiplies that rate by: full‑day presents + half‑day presents (0.5) + paid leaves.
2. Weekly attendance – summary by Sunday and salary slabs
Assumptions:
- Weekly sheet: row 3 = first employee; dates in D2:Z2; attendance in D3:Z3.
- Column C has the salary slab text:
DA240,DA220,DA200. - A separate summary sheet has:
- A cell (say B1) where a Sunday date is selected.
- A table listing slabs and their daily amounts, e.g.:
-
DA240→ 500 -
DA220→ 400 -
DA200→ 300 in Summary!E2:F4.
-
- On the weekly sheet, get the daily rate for each employee using
XLOOKUPorVLOOKUP:
or=XLOOKUP(C3, Summary!E2:E4, Summary!F2:F4)=VLOOKUP(C3, Summary!E2:F4, 2, FALSE) - On the summary sheet, to count attendance for the week ending on the Sunday in B1, use
SUMPRODUCTwith a date range covering that week. For example, if the week is Monday–Sunday and the dates are in Weekly!D2:Z2:
This returns the number of full‑day presents for all employees in that week. For half days:=SUMPRODUCT( (Weekly!$D$2:$Z$2>=B1-6) * (Weekly!$D$2:$Z$2<=B1) * (Weekly!$D$3:$Z$100="P") )=0.5*SUMPRODUCT( (Weekly!$D$2:$Z$2>=B1-6) * (Weekly!$D$2:$Z$2<=B1) * (Weekly!$D$3:$Z$100="0.5P") ) - Weekly salary for all employees for that Sunday:
=SUMPRODUCT( (Weekly!$D$2:$Z$2>=B1-6) * (Weekly!$D$2:$Z$2<=B1) * ( (Weekly!$D$3:$Z$100="P") + 0.5*(Weekly!$D$3:$Z$100="0.5P") ) * (XLOOKUP(Weekly!$C$3:$C$100, Summary!$E$2:$E$4, Summary!$F$2:$F$4)) )
This:
- Counts each employee’s present/half‑present days in the chosen week.
- Multiplies by that employee’s slab rate.
- Returns total salary to be paid for that week ending on the selected Sunday.
Adjust ranges, sheet names, and half‑day codes to match the actual workbook.
References:
- Using Solver to schedule your workforce
- combining multiple formulas in one cell (not an if statement, does multiple formulas to create one answer) - Microsoft Q&A
- XLOOKUP doesn't work properly with date range - Microsoft Q&A
- SUMIF returning #N/A-Function Argument returns FALSE when TRUE ??? - Microsoft Q&A