Formula with 4 conditions

amkkhan

Board Regular
Joined
Dec 11, 2021
Messages
75
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Actually I was making a database file where Student's results are being calculated dynamily.
But I am stuck about making the final pass or fail result when they pass 4 stages of exams in a class. Because for passing or failing for a student in 4 exam stages , there are certain conditions for a student to pas if he is fail in more then one subject.
 
Hi @Alex Blakenburg and @amkkhan
I just modified my formula to suite the range

Does it work? Just wanted to check if I could get it or not

Excel Formula:
=IF(COUNTIFS($E$7:$AB$7,"%age",E12:AB12,"<"&40,E12:AB12,">"&25)=1,"Promoted",IF(COUNTIFS($E$7:$AB$7,"%age",E12:AB12,"<"&40,E12:AB12,">"&30)=2,"Promoted",IF(COUNTIFS($E$7:$AB$7,"%age",E12:AB12,"<"&40)>2,"Fail","Pass")))
Hello Sufiyan, I don’t believe you can do it in a combined Countifs formula.
3 or more under 40 should generate a Fail.
In your combined version,
1 between 25-40 would pass the 1st test even if there were an additional 1 or more below 25
2 between 30-40 would pass the 2nd test even if there were an additional 1 or more below 25
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hello Alex thanks for the explanation
I still don't understand below points
In your combined version,
1 between 25-40 would pass the 1st test even if there were an additional 1 or more below 25
2 between 30-40 would pass the 2nd test even if there were an additional 1 or more below 25

Can you please explain it in changing the data in below sample


Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAE
3
4
5Roll NoNameExamT.NameT.NameT.NameT.NameT.NameT.NameT.NameTotal
6Sub. NameSub. NameSub. NameSub. NameSub. NameSub. NameSub. NameSufiyanAlex
7MMOM%ageMMOM%ageMMOM%ageMMOM%ageMMOM%ageMMOM%ageMMOM%ageT. MarksObtainedT. %ageGrade.
81Student Name1st BM(5%)25183.625214.225244.82525525193.825142.82525517514683.4A+
9MT(25%)1007017.510060155028141006516.31005513.850301550301555033861.5B
102nd BM(5%)25183.625214.225244.82525525193.825142.82525517514683.4A+
11FT(65%)1007017.510060155028141006516.31005513.850301550301555033861.5B
12Final Result10038.410038.410037.610042.510035.110035.61004070026838.2EFailFail
132Student Name1st BM(5%)25183.625214.225244.82525525193.825142.82525517514683.4A+
14MT(25%)1007017.510060155028141006516.31005513.850301550301555033861.5B
152nd BM(5%)25183.625214.225244.82525525193.825142.82525517514683.4A+
16FT(65%)1007017.510060155028141006516.31005513.850301550301555033861.5B
17Final Result10042.210038.410037.610042.510035.110035.61004070027138.8EFailFail
183Student Name1st BM(5%)25183.625214.225244.82525525193.825142.82525517514683.4A+
19MT(25%)1007017.510060155028141006516.31005513.850301550301555033861.5B
202nd BM(5%)25183.625214.225244.82525525193.825142.82525517514683.4A+
21FT(65%)1007017.510060155028141006516.31005513.850301550301555033861.5B
22Final Result10042.210038.410037.610042.510035.110035.61004070027138.8EFailFail
23
24
25
Sheet2
Cell Formulas
RangeFormula
AC12,AC22,AC17AC12=IF(COUNTIFS($E$7:$AB$7,"%age",E12:AB12,"<"&40,E12:AB12,">"&25)=1,"Promoted",IF(COUNTIFS($E$7:$AB$7,"%age",E12:AB12,"<"&40,E12:AB12,">"&30)=2,"Promoted",IF(COUNTIFS($E$7:$AB$7,"%age",E12:AB12,"<"&40)>2,"Fail","Pass")))
AD12,AD22,AD17AD12=IF(COUNTIFS($D12:$AB12,"<40",$D$7:$AB$7,"%age")=0,"Pass",IF(AND(COUNTIFS($D12:$AB12,"<40",$D$7:$AB$7,"%age")=1,COUNTIFS($D12:$AB12,"<=25",$D$7:$AB$7,"%age")=0),"Promoted",IF(AND(COUNTIFS($D12:$AB12,"<40",$D$7:$AB$7,"%age")=2,COUNTIFS($D12:$AB12,"<=30",$D$7:$AB$7,"%age")=0),"Promoted","Fail")))
 
Upvote 0
@Sufiyan97 change any 1 of your < 40 values to a number between 26-29 and tell me if you still get Fail.
eg change F12 to 27

Yes still getting Fail

Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD
4
5Roll NoNameExamT.NameT.NameT.NameT.NameT.NameT.NameT.NameTotal
6Sub. NameSub. NameSub. NameSub. NameSub. NameSub. NameSub. NameSufiyanAlex
7MMOM%ageMMOM%ageMMOM%ageMMOM%ageMMOM%ageMMOM%ageMMOM%ageT. MarksObtainedT. %ageGrade.
81Student Name1st BM(5%)25183.625214.225244.82525525193.825142.82525517514683.4A+
9MT(25%)1007017.510060155028141006516.31005513.850301550301555033861.5B
102nd BM(5%)25183.625214.225244.82525525193.825142.82525517514683.4A+
11FT(65%)1007017.510060155028141006516.31005513.850301550301555033861.5B
12Final Result1002710038.410037.610042.510035.110035.61004070026838.2EFailFail
Sheet2
Cell Formulas
RangeFormula
AC12AC12=IF(COUNTIFS($E$7:$AB$7,"%age",E12:AB12,"<"&40,E12:AB12,">"&25)=1,"Promoted",IF(COUNTIFS($E$7:$AB$7,"%age",E12:AB12,"<"&40,E12:AB12,">"&30)=2,"Promoted",IF(COUNTIFS($E$7:$AB$7,"%age",E12:AB12,"<"&40)>2,"Fail","Pass")))
AD12AD12=IF(COUNTIFS($D12:$AB12,"<40",$D$7:$AB$7,"%age")=0,"Pass",IF(AND(COUNTIFS($D12:$AB12,"<40",$D$7:$AB$7,"%age")=1,COUNTIFS($D12:$AB12,"<=25",$D$7:$AB$7,"%age")=0),"Promoted",IF(AND(COUNTIFS($D12:$AB12,"<40",$D$7:$AB$7,"%age")=2,COUNTIFS($D12:$AB12,"<=30",$D$7:$AB$7,"%age")=0),"Promoted","Fail")))
 
Upvote 0
Sorry not at my computer and was trying to edit that. You have a lot under 40. Make all your under 40s 20 and then make F12 27
 
Upvote 0
Thanks Alex
Got your point now getting Promoted which is not correct

Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAE
4
5Roll NoNameExamT.NameT.NameT.NameT.NameT.NameT.NameT.NameTotal
6Sub. NameSub. NameSub. NameSub. NameSub. NameSub. NameSub. NameSufiyanAlex
7MMOM%ageMMOM%ageMMOM%ageMMOM%ageMMOM%ageMMOM%ageMMOM%ageT. MarksObtainedT. %ageGrade.
81Student Name1st BM(5%)25183.625214.225244.82525525193.825142.82525517514683.4A+
9MT(25%)1007017.510060155028141006516.31005513.850301550301555033861.5B
102nd BM(5%)25183.625214.225244.82525525193.825142.82525517514683.4A+
11FT(65%)1007017.510060155028141006516.31005513.850301550301555033861.5B
12Final Result1002710020100201002010020100201002070026838.2EPromotedFail
Sheet2
Cell Formulas
RangeFormula
AC12AC12=IF(COUNTIFS($E$7:$AB$7,"%age",E12:AB12,"<"&40,E12:AB12,">"&25)=1,"Promoted",IF(COUNTIFS($E$7:$AB$7,"%age",E12:AB12,"<"&40,E12:AB12,">"&30)=2,"Promoted",IF(COUNTIFS($E$7:$AB$7,"%age",E12:AB12,"<"&40)>2,"Fail","Pass")))
AD12AD12=IF(COUNTIFS($D12:$AB12,"<40",$D$7:$AB$7,"%age")=0,"Pass",IF(AND(COUNTIFS($D12:$AB12,"<40",$D$7:$AB$7,"%age")=1,COUNTIFS($D12:$AB12,"<=25",$D$7:$AB$7,"%age")=0),"Promoted",IF(AND(COUNTIFS($D12:$AB12,"<40",$D$7:$AB$7,"%age")=2,COUNTIFS($D12:$AB12,"<=30",$D$7:$AB$7,"%age")=0),"Promoted","Fail")))
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,078
Latest member
skydd

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