Hi, i have a table:

Name Apples
Ken 2
James 5
James 5
John 3

Without pivot tables, I want the formula of total sum of apples of every name but not duplicates, in this case: 10.
How can this be done?