Formula that deducts points for each code I input.

bricegoing

New Member
Joined
Sep 23, 2020
Messages
15
Office Version
  1. 365
Platform
  1. Windows
I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor Participation, T for Tardy, etc...) have them lose that number of points. I have each code and the number of points it deducts on another sheet in excel but don't know how to make it look up the code and then deducts the points. Thanks for any help!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Ok, that means you don't yet have the latest update.
Try
Employability Grades Auto Grade.xlsx
ABCDEF
111/09/202018/09/202025/09/202002/10/202009/10/2020
2StudentEmployabilityEmployabilityEmployabilityEmployabilityEmployability
3Gavin BellPP,T,SSL,L
4100100503030
Carpentry II A Day
Cell Formulas
RangeFormula
B4B4=100-SUM(IFERROR(VLOOKUP(TRIM(MID(SUBSTITUTE(B3,",",REPT(" ",15)),{1,16,31,46,61},15)),Deductions!$A$3:$B$15,2,0),0))
C4:F4C4=B4-SUM(IFERROR(VLOOKUP(TRIM(MID(SUBSTITUTE(C3,",",REPT(" ",15)),{1,16,31,46,61},15)),Deductions!$A$3:$B$15,2,0),0))
 
Upvote 0
Ok, that means you don't yet have the latest update.
Try
Employability Grades Auto Grade.xlsx
ABCDEF
111/09/202018/09/202025/09/202002/10/202009/10/2020
2StudentEmployabilityEmployabilityEmployabilityEmployabilityEmployability
3Gavin BellPP,T,SSL,L
4100100503030
Carpentry II A Day
Cell Formulas
RangeFormula
B4B4=100-SUM(IFERROR(VLOOKUP(TRIM(MID(SUBSTITUTE(B3,",",REPT(" ",15)),{1,16,31,46,61},15)),Deductions!$A$3:$B$15,2,0),0))
C4:F4C4=B4-SUM(IFERROR(VLOOKUP(TRIM(MID(SUBSTITUTE(C3,",",REPT(" ",15)),{1,16,31,46,61},15)),Deductions!$A$3:$B$15,2,0),0))
I'm so sorry this is taking so much of your time.. Its working but only for the first code. If I put PP it correctly goes down to 80, but if I put PP,T or any other second code it stays at 80
 
Upvote 0
Oops forgot to mention it will need to be confirmed with Ctrl Shift Enter & not just enter.
 
Upvote 0
Oops forgot to mention it will need to be confirmed with Ctrl Shift Enter & not just enter.
I did the cntrl shift enter and it put the {} on it but its still only reading the first code. I tried PP,T PP, T and PPT
 
Upvote 0
Maybe older version of Excel can't handle an array like & I don't have an old version to test on.
 
Upvote 0
In older versions of Excel, lookup functions inside of an array formula are pretty much a no-no. Try this though:

Book1
ABCDEF
19/11/20209/18/20209/25/202010/2/202010/9/2020
2StudentEmployabilityEmployabilityEmployabilityEmployabilityEmployability
3Gavin BellPP,T,SSL,L
41001005030100
Sheet3
Cell Formulas
RangeFormula
B4:F4B4=100-SUMPRODUCT(--ISNUMBER(SEARCH(","&Deductions!$A$3:$A$15&",",","&B3&",")),Deductions!$B$3:$B$15)


This assumes that you only have a given code in a cell one time. If you could have PP more than once, I can come up with something with SUMIF instead.
 
Upvote 0
In older versions of Excel, lookup functions inside of an array formula are pretty much a no-no. Try this though:

Book1
ABCDEF
19/11/20209/18/20209/25/202010/2/202010/9/2020
2StudentEmployabilityEmployabilityEmployabilityEmployabilityEmployability
3Gavin BellPP,T,SSL,L
41001005030100
Sheet3
Cell Formulas
RangeFormula
B4:F4B4=100-SUMPRODUCT(--ISNUMBER(SEARCH(","&Deductions!$A$3:$A$15&",",","&B3&",")),Deductions!$B$3:$B$15)


This assumes that you only have a given code in a cell one time. If you could have PP more than once, I can come up with something with SUMIF instead.
This works!! Thank you so much. Excel is not my thing but you and fluff have really impressed me with your knowledge of excel and it honestly makes me want to learn more. Thanks for all the help guys!
 
Upvote 0

Forum statistics

Threads
1,214,957
Messages
6,122,466
Members
449,086
Latest member
kwindels

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