Counting Theory and Practical Periods with Conditions

hotbird

New Member
Joined
Jan 21, 2023
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
There are two sheets in my excel file, named 1) Basic_Info and 2) Sep
1) In this Sep sheet Mech-246 and others represents the subject name.
2) Th stands for Theroy period and Pr stands for Practical period.
3) First four periods (1,2,3,4,) are paid at half the rate and the last four periods (5,6,7,8) are paid at full rates except Friday.
4) On friday all the periods are paid at full rate.
5) There are only six periods taught on friday ( 3 to 8).
------------------------
6) I want to count number of theory periods (half and full paid separately) at the end of the sheet.
7) Similary i also want to count number of practical periods paid at full and half rate separately.
8) I have used countif function but it does not work.
9) countifs function does not give output.
10) i have also tried sumproduct, if and weekday functions but doesnot know how to write these functions correctly.
11) In this sheet Full rate theroy periods are 17 and half rate theroy periods are 9.
12) Similary full rate practical periods are 38 and half rate practical periods are 28.

Note:
1) Cell A8 is linked to the other sheet and cell A9 thorugh A37 contain formulas A8+1, A9+1 etc to get dates.
2) Similary cell B8 gets function weekday to get day from dates in A8, A9 etc.

Help will be appreciated. Thanks

Basic_Info Sheet:
Example.xlsx
ABCDE
1Basic Info for Second Shift Bills
2Teacher'sAccount Information
3NameAccount No.Bank Name (in short)Branch
4ABCD0XYZNYC
5
6Month with YearRateBill Printing Date
7TheoryPractical
8Sep-2022
9Oct-2022
10Nov-2022
11Dec-2022
12Jan-2023
13Feb-2023
14Mar-2023
15Apr-2023
16May-2023
17Jun-2023
18Jul-2023
19
Basic_Info


Sep Sheet:
Example.xlsx
ABCDEFGHIJKL
1College Name
2Attendance Proforma
3
4Name of Teacher :ABCDMonth :September - 2022
5
6DateDayPeriods Verified by
712345678
81ThuMech-372 ThMech-246 M/S Pr (A)Mech-246 M/S Pr (A)Mech-246 M/S Pr (A)
92FriXXMech-246 Th (B)Mech-246 M/S Pr (B)Mech-246 M/S Pr (B)Mech-246 M/S Pr (B)
103SatMech-372 PrMech-372 PrMech-372 Pr
114Sun
125MonMech-363 PrMech-363 PrMech-363 PrMech-363 ThMech-363 ThMech-372 Th
136TueMech-246 M/S Pr (A)Mech-246 M/S Pr (A)Mech-246 M/S Pr (A)
147WedMech-246 Th (A)
158ThuMech-372 ThMech-246 M/S Pr (A)Mech-246 M/S Pr (A)Mech-246 M/S Pr (A)
169FriXXMech-246 Th (B)Mech-246 M/S Pr (B)Mech-246 M/S Pr (B)Mech-246 M/S Pr (B)
1710SatMech-372 PrMech-372 PrMech-372 Pr
1811Sun
1912MonMech-363 PrMech-363 PrMech-363 PrMech-363 ThMech-363 ThMech-372 Th
2013TueMech-246 M/S Pr (A)Mech-246 M/S Pr (A)Mech-246 M/S Pr (A)
2114WedMech-246 Th (A)
2215ThuMech-372 ThMech-246 M/S Pr (A)Mech-246 M/S Pr (A)Mech-246 M/S Pr (A)
2316FriXXMech-246 Th (B)Mech-246 M/S Pr (B)Mech-246 M/S Pr (B)Mech-246 M/S Pr (B)
2417SatMech-372 PrMech-372 PrMech-372 Pr
2518Sun
2619MonMech-363 PrMech-363 PrMech-363 PrMech-363 ThMech-363 ThMech-372 Th
2720TueMech-246 M/S Pr (A)Mech-246 M/S Pr (A)Mech-246 M/S Pr (A)
2821WedMech-246 Th (A)
2922ThuMech-372 ThMech-246 M/S Pr (A)Mech-246 M/S Pr (A)Mech-246 M/S Pr (A)
3023FriXXMech-246 Th (B)Mech-246 M/S Pr (B)Mech-246 M/S Pr (B)Mech-246 M/S Pr (B)
3124SatMech-372 PrMech-372 PrMech-372 Pr
3225Sun
3326MonMech-363 PrMech-363 PrMech-363 PrMech-363 ThMech-363 ThMech-372 Th
3427TueMech-246 M/S Pr (A)Mech-246 M/S Pr (A)Mech-246 M/S Pr (A)
3528WedMech-246 Th (A)
3629ThuMech-372 ThMech-246 M/S Pr (A)Mech-246 M/S Pr (A)Mech-246 M/S Pr (A)
3730FriXXMech-246 Th (B)Mech-246 M/S Pr (B)Mech-246 M/S Pr (B)Mech-246 M/S Pr (B)
38
39
40Periods:TheoryPractical
41Full Rate1233
42Half Rate1433
43Total2666Signature of Teacher :
44
45
Sep
Cell Formulas
RangeFormula
D4D4=Basic_Info!A4
I4I4=Basic_Info!A8
A8A8=Basic_Info!A8
B8:B37B8=WEEKDAY(A8)
A9:A37A9=A8+1
D41D41=COUNTIF(G8:J37, "*Th*")
E41E41=COUNTIF(G8:J37, "*Pr*")
D42D42=COUNTIF(C8:F37, "*Th*")
E42E42=COUNTIF(C8:F37, "*Pr*")
D43:E43D43=SUM(D41:D42)
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi & welcome to MrExcel.
How about
Excel Formula:
=SUMPRODUCT(((B8:B37=6)*(ISNUMBER(SEARCH("Th",C8:F37))))+(ISNUMBER(SEARCH("Th",G8:J37))))
and
Excel Formula:
=SUMPRODUCT((B8:B37<>6)*(ISNUMBER(SEARCH("Th",C8:F37))))
 
Upvote 1
Solution
@Fluff Thanks for welcoming.
The formula is working fine. I am very happy with it.
Thanks a lot.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 1
Hello;
Now i want some change in counting. All above conditions are same except condition 3. New condition is as;
3) First two periods (1,2) are paid at half the rate and the last six periods (3,4,5,6,7,8) are paid at full rates except Friday.
 
Upvote 0
How about
Excel Formula:
=SUMPRODUCT(((B8:B37=6)*(ISNUMBER(SEARCH("Th",C8:D37)))))+SUMPRODUCT(--(ISNUMBER(SEARCH("Th",E8:J37))))
and
Excel Formula:
=SUMPRODUCT((B8:B37<>6)*(ISNUMBER(SEARCH("Th",C8:D37))))
 
Upvote 1
You're welcome & thanks for the feedback.
 
Upvote 1

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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