Get a % based on a category and the total amount of that category

PresFox

New Member
Joined
Nov 21, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello there,

I am making an analysis tool for a test at the school I work at.

What I have:
A table containing the question numbers (1 to 20), the category each question belongs to (1 to 5), and a list of names. The teacher will add a 1 if a question is answered wrong.

What I want:
To make this sheet usable for other tests (wich have the same amount of questions, though the amount per category might change), I want excel to calculate a % based on the amount of questions that fall in a certain category and the total amount of them. Tried to work with HLOOKUP, but that does not seem to work. Always says 1.

This is the sheet I work with:
eSRotaR.png

Any help would be greatly appreciated!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
something like
not sure of the ranges you are using
=countif($B$2:$Z$2, Right(B200,1))
This will count all the questions that are in the cat - assuming Cat 1, cat 2 etc is in row200
Then you need to sumup the correct answers
BUT I dont know how that is shown - are they just blank cells ?
Again a SUMIFS() maybe , or maybe a SUMPRODUCT() to add all the 1's by pupil or add up the correct answers , not sure how they are shown - and subtract from the max per category
then to get a %
=SUMIFS( )/countif()

can you use XL2BB add-in - see signature / menu for how
OR
put a sample onto a share like dropbox/onedrive/google sheets

BUT how are correct question marked
 
Upvote 0
How about this?

Book1
ABCDEFGHIJKLMNOPQRSTU
1Category11221333445441133445
2Number1234567891011121314151617181920
3Pietje1111111111
4Jan1111111
5Klaas
6
7Categories
8Analysis12345
9Pietje40%50%60%50%50%
10Jan100%0%40%0%0%
11Klaas0%0%0%0%0%
Sheet1
Cell Formulas
RangeFormula
B2:U2B2=SEQUENCE(,20)
B8:F8B8=SEQUENCE(,5)
B9:F11B9=LET(cat,$B$1:$U$1,nam,$A$3:$A$5,d,$B$3:$U$5,f,SUMPRODUCT((cat=B$8)*(nam=$A9)*d),t,SUMPRODUCT(--(cat=B$8)),f/t)
Dynamic array formulas.
 
Upvote 0
Thanks!

One question, got an error about names. What is "cat" and "nam" in this formula?
 
Upvote 0
I saw that you were on office 365 and assumed that you had the 'Let' function available.

Try this instead.

Book1
ABCDEFGHIJKLMNOPQRSTU
1Category11221333445441133445
2Number1234567891011121314151617181920
3Pietje1111111111
4Jan1111111
5Klaas
6
7Categories
8Analysis12345
9Pietje40%50%60%50%50%
10Jan100%0%40%0%0%
11Klaas0%0%0%0%0%
Sheet1
Cell Formulas
RangeFormula
B2:U2B2=SEQUENCE(,20)
B8:F8B8=SEQUENCE(,5)
B9:F11B9=SUMPRODUCT(($B$1:$U$1=B$8)*($A$3:$A$5=$A9)*$B$3:$U$5)/SUMPRODUCT(--($B$1:$U$1=B$8))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,718
Members
448,986
Latest member
andreguerra

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