Sumproduct not correct

Tigerexcel

Active Member
Joined
Mar 6, 2020
Messages
493
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Book4
ABCDEFGHIJKLMNOPQR
1ID no.CourseUnit1Unit2Unit3Unit4Unit5Unit6Unit7Unit8Countif CreditsSumproduct CreditsCredits given
2ID 1DiplomaABC2020 56-PABC2040 28-NABC1110 30-NABC1090 61-CABC2690 61-CABC2090 28-NABC1110 50-PABC1040 61-C20DiplomaABC2*PABC2*CABC2*D
3ID 2CertificateABC2020 36-NABC2090 81-HDABC2040 66-CABC2040 66-CABC2040 66-CABC2070 66-CABC2140 66-CABC2100 66-CCertificateABC2*PABC2*CABC2*D ABC1040
4ID 3DegreeABC2110 50-PABC1110 50-PABC1110 50-PABC1040 61-CDegreeABC2*CABC2*D
5ID 4DiplomaABC2110 50-PABC1110 50-PABC1110 50-PABC1040 61-C
Sheet1
Cell Formulas
RangeFormula
K2K2=SUM(COUNTIF(C2:J2,$O$2:$Q$2))
L2L2=SUMPRODUCT(1*(C2:J2=$N$6:$N$8))
Press CTRL+SHIFT+ENTER to enter array formulas.

I can get this to work if I stick with Countif but I'd like to know what I have to tweak to get the Sumproduct to work. Basically in this example I am trying to work out credits based on student results. There is an added complication here in that the number of credits will vary according to the level of qualification so in this system a certificate would receive less credits than a diploma. I think I can work out a lookup/choose option for that part. It's the Sumproduct part that has me puzzled. I have used Sumproduct for a similar example and it worked fine, I get a little closer if I have the credits displayed vertically but I'm still getting #N/A errors so I thought I'd post here. I've only worked out the credits for the first record, once I get clarity for that I'll fill in the rest.
 
Hii i have tied to use * card in sumproduct and it seems it is working fine
You can't use a wildcard as a direct criteria (in the way that the OP tried to in post 1).
If you read the thread before posting you would see that I already explained the problem and demonstrated the use of ISNUMBER(SEARCH( as a method that does work in post 3.
 
Upvote 0

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
The method that I used in post 7 needs either sumproduct or sum with ctrl shift enter. The method doesn't work with sumifs as the wildcards would be in the wrong part of the formula.

Then there is the basic use of sumproduct for which it was originally intended, to multiply the values in each row or a range (product) then add the results of each row (sum) in a single formula.

Not sure how you're seeing that based on the example, the numbers in column O denote the credits awarded, I just used 1, 2 and 3 for testing. As far as I can see all of the results in the sample match the criteria and the test values, ID1 receives 2 credits each for Unit1 and Unit5, ID3 has no units that match the criteria table.
I can see what I did wrong now (it's the ABC1040), your formula works great for the information I provided and will work for 98% of the data. The problem is when someone records a N for ABC1040, in this case there is no credit and should not record a 1 in column O.
 
Upvote 0
From that, am I right in saying that ABC1040 61-C should be counted (subject to course type being correct) but not ABC1040 61-N ?

To exclude it, the easiest way would be to list the alternatives in the reference table, ABC1040*S ABC1040*N etc but with a zero credit in column 0 for the latter.
 
Upvote 0
From that, am I right in saying that ABC1040 61-C should be counted (subject to course type being correct) but not ABC1040 61-N ?

To exclude it, the easiest way would be to list the alternatives in the reference table, ABC1040*S ABC1040*N etc but with a zero credit in column 0 for the latter.
Thanks, increasing the size of the reference table did the trick. Impressive use of Sumproduct, you've got no idea how much time this will save, thanks again.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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