Replacing lowest score that is at least 70

updiliman

New Member
Joined
Sep 9, 2018
Messages
5
Say I have 4 quizzes, and there is an optional Review Session. Student gets either 100 or 0 for attending/not attending the review session. If student attends the review, their lowest quiz scores will be replaced by 100, provided the quiz to be replaced is at least 70. Please note that there could be duplicates in the quiz scores, replacing the first instance is enough.

Example:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Orig Q1[/TD]
[TD]Orig Q2[/TD]
[TD]Orig Q3[/TD]
[TD]Orig Q4[/TD]
[TD]Review Session (0 or 100 only)[/TD]
[TD]New Q1[/TD]
[TD]New Q2[/TD]
[TD]New Q3[/TD]
[TD]New Q4[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]70[/TD]
[TD]80[/TD]
[TD]90[/TD]
[TD]100[/TD]
[TD]20[/TD]
[TD]100[/TD]
[TD]80[/TD]
[TD]90
[/TD]
[/TR]
[TR]
[TD]80[/TD]
[TD]80[/TD]
[TD]30[/TD]
[TD]95[/TD]
[TD]100[/TD]
[TD]100[/TD]
[TD]80[/TD]
[TD]30[/TD]
[TD]95[/TD]
[/TR]
</tbody>[/TABLE]

In the 1st example, Q2=70 is the lowest score (should only consider quizzes that are at least 70), so it is replaced by 100.
In the 2nd example, 80 is the lowest score (that is at least 70), but there are repeated scores, only the first instance is to be replaced by 100.
If Review session = 0, then No change.

Thanks so much in advance !
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Welcome to the MrExcel board!

If you have a recent Excel version with the MINIFS function then try this, copied across and down.

Excel Workbook
ABCDEFGHI
1Orig Q1Orig Q2Orig Q3Orig Q4ReviewNew Q1New Q2New Q3New Q4
220708090100201008090
380803095100100803095
Replace





If you don't have MINIFS but at least Excel 2010 then use this instead.

=IF(AND($E2=100,A2=AGGREGATE(15,6,$A2:$D2/($A2:$D2>=70),1),COUNTIF($A2:A2,A2)=1),100,A2)


If your version is even older (or you need this to work on all Excel versions) then use this. It is an array formula so should be entered without the {} but confirmed with Ctrl+Shift+Enter, not just Enter. If confirmed correctly, Excel will insert the {}. The formula can then be copied down.
{=IF(AND($E2=100,A2=MIN(IF($A2:$D2>=70,$A2:$D2)),COUNTIF($A2:A2,A2)=1),100,A2)}
 
Last edited:
Upvote 0
I have a problem with this formula,

If there are 2 quiz scores that are 0, it replaces the 0 by 100, we dont want this because 0 is not >=70. How to fix this ? Thanks so much
 
Upvote 0
OK, try

=IF(AND(MAX($A2:$D2)>=70,$E2=100,A2=MINIFS($A2:$D2,$A2:$D2,">=70"),COUNTIF($A2:A2,A2)=1),100,A2)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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