Complete month attendance allowance

Zubair

Active Member
Joined
Jul 4, 2009
Messages
304
Office Version
  1. 2016
Platform
  1. Windows
Hi Experts,

I have a 37 Column month wise structure and in last column count of P.

I want to add Sunday as well if full month P is available during working days as Sunday is holiday.

Like in July
AAA = 27 + 4 (Sun) = 31 (Full month attendance)
BBB = 26 + 0 = 26 (1 Absent during the month)

FC1July 2021
Employee NameSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMon
272829301234567891011121314151617181920212223242526272829303112
AAAPPPPPPPPPPPPPPPPPPPPPPPPPPP27
BBBPPPPPPPPPPPPPPPPPPPPPPPPPPA26


In August
AAA = 26 + 5 (Sun) = 31 (Full month attendance)
BBB = 24 + 0 = 24 (2 Absents during the month)
FC1August 2021
Employee NameSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMon
12345678910111213141516171819202122232425262728293031123456
AAAPPPPPPPPPPPPPPPPPPPPPPPPPP26
BBBPPPPPPPPPPPPPPPPPPPPPPPPAA24
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
To count sundays between 2 dates
TEST FILE.xlsm
A
101-Jul
231-Jul
34
Sheet5
Cell Formulas
RangeFormula
A3A3=SUMPRODUCT((WEEKDAY(ROW(INDIRECT(A1&":"&A2)))=1)*1)


Add this to your current formula
 
Upvote 0
Hi hrayani - many thanks its working in case of full attendance of the month, how can I exclude if any day a person is absent during the month in case of BBB?
 
Upvote 0
TEST FILE.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAG
1FC1July 2021
2Employee NameThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSat
3ZubairPPPPPPPPPPPPPPPPPPPPPPPPPPP31
4HumayunPPPPPPPPPPPPPPPPPPPPPPPPPPA26
5
6FC1August 2021
7Employee NameSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTue
8ZubairPPPPPPPPPPPPPPPPPPPPPPPPPP31
9HumayunPPPPPPPPPPPPPPPPPPPPPPPPAA24
Sheet5
Cell Formulas
RangeFormula
AG3:AG4AG3=IF(COUNTIF(B3:AF3,"A")>0,COUNTIF(B3:AF3,"P"),COUNTIF(B3:AF3,"P")+SUMPRODUCT((WEEKDAY(ROW(INDIRECT($B$2&":"&$AF$2)))=1)*1))
AG8:AG9AG8=IF(COUNTIF(B8:AF8,"A")>0,COUNTIF(B8:AF8,"P"),COUNTIF(B8:AF8,"P")+SUMPRODUCT((WEEKDAY(ROW(INDIRECT($B$7&":"&$AF$7)))=1)*1))
 
Upvote 0
Excellent hrayani many thanks, 1 more request please

I am applying the above formula in all months and in Sep for example without A or P its showing 4, how can I amend formula to show blank in total column if the month not started ?

FC1September 2021
Employee NameSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMon
2930311234567891011121314151617181920212223242526272829301234
Zubair4
Humayun4
Azeem4
 
Upvote 0
TEST FILE.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAG
1FC1July 2021
2Employee NameThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSat
3ZubairPPPPPPPPPPPPPPPPPPPPPPPPPPP31
4HumayunPPPPPPPPPPPPPPPPPPPPPPPPPPA26
5
6FC1August 2021
7Employee NameSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTue
8ZubairPPPPPPPPPPPPPPPPPPPPPPPPPP31
9HumayunPPPPPPPPPPPPPPPPPPPPPPPPAA24
Sheet5
Cell Formulas
RangeFormula
AG3:AG4AG3=IF(AND(COUNTIF(B3:AF3,"P")=0,COUNTIF(B3:AF3,"A")=0),"",IF(COUNTIF(B3:AF3,"A")>0,COUNTIF(B3:AF3,"P"),COUNTIF(B3:AF3,"P")+SUMPRODUCT((WEEKDAY(ROW(INDIRECT($B$2&":"&$AF$2)))=1)*1)))
AG8:AG9AG8=IF(AND(COUNTIF(B8:AF8,"P")=0,COUNTIF(B8:AF8,"A")=0),"",IF(COUNTIF(B8:AF8,"A")>0,COUNTIF(B8:AF8,"P"),COUNTIF(B8:AF8,"P")+SUMPRODUCT((WEEKDAY(ROW(INDIRECT($B$7&":"&$AF$7)))=1)*1)))
 
Upvote 0
Solution
Many thanks all requirements covered in your given formula, Jazakallah Khair
 
Upvote 0
1 additional request, F = Half day, needs to be added in this formula, means if user select F the formula shall count 0.5
 
Upvote 0
1 additional request, F = Half day, needs to be added in this formula, means if user select F the formula shall count 0.5
See if this helps

TEST FILE.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAG
1FC1Jul-21
2Employee NameThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSat
3ZubairPPPPPPPPPPPPPPPPPPPPPPPFFFP29.50
4HumayunPPPPPPPPPPPPPPPPPPPPPFFFPPA24.50
5
6FC1Aug-21
7Employee NameSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTue
8ZubairPPPPPPPPPPPPPPPPPPFFPPFPPP29.50
9HumayunPPPPPPPPPPPPPPPPPPPPPPFPAA23.50
Sheet5
Cell Formulas
RangeFormula
AG3:AG4AG3=IF(AND(COUNTIF(B3:AF3,"P")=0,COUNTIF(B3:AF3,"A")=0),"",IF(COUNTIF(B3:AF3,"A")>0,COUNTIF(B3:AF3,"P")+COUNTIF(B3:AF3,"F")/2,COUNTIF(B3:AF3,"P")+COUNTIF(B3:AF3,"F")/2+SUMPRODUCT((WEEKDAY(ROW(INDIRECT($B$2&":"&$AF$2)))=1)*1)))
AG8:AG9AG8=IF(AND(COUNTIF(B8:AF8,"P")=0,COUNTIF(B8:AF8,"A")=0),"",IF(COUNTIF(B8:AF8,"A")>0,COUNTIF(B8:AF8,"P")+COUNTIF(B8:AF8,"F")/2,COUNTIF(B8:AF8,"P")+COUNTIF(B8:AF8,"F")/2+SUMPRODUCT((WEEKDAY(ROW(INDIRECT($B$7&":"&$AF$7)))=1)*1)))
 
Upvote 0

Forum statistics

Threads
1,214,927
Messages
6,122,309
Members
449,080
Latest member
jmsotelo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top