Sum Column Values if Matching Values Exist In Another Column, excluding first occurence

mrscottjr

New Member
Joined
Jul 24, 2015
Messages
41
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi all,

Hoping you can help. I'm in need of a formula to search if a cell's value is a duplicate, triplicate, etc within a column. If multiples are found, I want to sum the values from another column in those rows - excluding the first occurence.

In my example below, I'm trying to find a formula for the "Retaken Credits" column. I'd like to see if the value in the "Course Code" is found more than once in the "Course Code" column. If it is, I'd like to sum the number of credits but not include the initial attempt's course credits, as I only want to have the "retaken credits" appear in that column. In the example, you can see that MA 101 was taken twice meaning only 4 credits were "retaken" (as opposed to the sum of all MA 101 credits being 8). For LA 101, you can see that it was taken 3 times - therefore I want it to show 6 credits in the retaken column (as opposed to the actual sum of all attempts being 9 credits.) The next step for me is creating two cells somewhere else on the spreadsheet that will show the "Total Credits Taken" (which would be 27 in the example) and a "Retaken Credits Only" value (which would be 10 in the example)

Book1
ABCDE
1CourseCourse NameCreditsRetaken CreditsDesired Output for Column D
2PS 101Psychology3(Formula??)
3EN 101Engish4(Formula??)
4SC 101Science3(Formula??)
5MA 101Math4(Formula??)
6MA 101Math4(Formula??)4
7LA 101Language3(Formula??)
8LA 101Language3(Formula??)3
9LA 101Language3(Formula??)3
10
11Total Taken Credits27
12Total Retaken Credits 10
Sheet1
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
See if this works for you.

20210503 Omit first occurence value.xlsx
ABCDE
1CourseCourse NameCreditsRetaken CreditsDesired Output for Column D
2PS 101Psychology3 
3EN 101Engish4 
4SC 101Science3 
5MA 101Math4 
6MA 101Math444
7LA 101Language3 
8LA 101Language333
9LA 101Language333
10
11Total Taken Credits27
12Total Retaken Credits 10
Data Table
Cell Formulas
RangeFormula
D2:D9D2=IF(ROW([@Course])=MATCH([@Course],[Course],0)+ROW(tblCourses[[#Headers],[Course]]),"",[@Credits])
 
Upvote 0
Solution
Glad I could help.
I later thought I should have offered this as an option as well.
It relies on the $A$2:$A2 expanding each time it gets copied down a row.

Excel Formula:
=IF(COUNTIFS($A$2:$A2,[@Course])=1,"",[@Credits])
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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