Can I combine SUMIF and CHOOSE ?

palaeontology

Active Member
Joined
May 12, 2017
Messages
444
Office Version
  1. 2016
Platform
  1. Windows
I have the following 'dummy' data ...

weighted averages 1.JPG


As you can see there are 5 exams, and three students.

As the year progresses, the exams become more and more difficult and so their weighting reflects this increase in difficulty.

In J7 I have the following formula ...

w.a.1.JPG


it obviously has two components ... a SUMPRODUCT and a SUMIF

You can see in green (in columns K and L) what each of these components comes to ... obviously, Mike and Aryu have both missed an exam or two and so their weighted total out-ofs differ from Joe as he has sat all 5 exams.

I then experimented with trying to achieve the same result when the cells are not contiguous .....

WEIGHTED AVERAGES 2.JPG


I had to change the SUMPRODUCT formula in V7 to allow for the fact the cells are not contiguous. So I used the CHOOSE function.

wa 3.JPG


as you can see by the correct calculations in green in column V, SUMPRODUCT has no problem combining with CHOOSE.

However, when I try to combine CHOOSE with SUMIF in column W, I get an error. This is my formula ...

wa4.JPG


Can SUMIF combine with CHOOSE, or have I done something wrong ?

Kind regards,

Chris
 

Attachments

  • weighted average c.JPG
    weighted average c.JPG
    12.2 KB · Views: 9

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,
I believe that there's a simple fix:
You should express your weights as percentages instead of whole numbers i.e 5=>.05
Then you can simply do a SUMPROD of your weights and test scores. No longer have the need to divide by the SUMIF.
 
Upvote 0
Tell me if I'm wrong. You need to provide the total possible score of each test say in row 3.
=Sumproduct(D4:H4,D7:H7)/sumproduct(D4:H4,D3:H3)

My belief is that the factor you use to weight the tests doesn't matter. Although I have preferred values that added up to 100 like you have
 
Upvote 0
Hi,
I believe that there's a simple fix:
You should express your weights as percentages instead of whole numbers i.e 5=>.05
Then you can simply do a SUMPROD of your weights and test scores. No longer have the need to divide by the SUMIF.
Your final weighted averages are incorrect for Mike and Aryu: It should be 72.5 and 59.6 , respectively
1637192015874.png
 
Upvote 0
Try

Pasta1
ABCDEFGHIJKLMNOPQRST
1
2
3
4Weighting510152050
5
6Test 1 (%)Test 2 (%)Test 3 (%)Test 4 (%)Test 5 (%)Result
7Joe687264837674,80
8Mike8281798985,29
9Aryu64788379,47
10
Plan6
Cell Formulas
RangeFormula
T7:T9T7=SUMPRODUCT(--ISNUMBER(SEARCH("Test",D$6:S$6)),D$4:S$4,D7:S7)/SUMPRODUCT(--ISNUMBER(SEARCH("Test",D$6:S$6)),--(D7:S7<>""),D$4:S$4)


M.
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,924
Members
452,366
Latest member
TePunaBloke

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