For the first question, assuming you have names in A2:A8 and values in B2:B8 you can use this array formula in C2

=SUM(IF(SUMIFS(B$2:B$8,A$2:A$8,A$2:A$8)>SUMIFS(B$2:B$8,A$2:A$8,A2),IF(MATCH(A$2:A$8,A$2:A$8,0)=ROW(A$2:A$8)-ROW(A$2)+1,1)))+1

confirmed with CTRL+SHIFT+ENTER and copied down to C8

If you want to reverse the rankings just use < in place of >

You can still get duplicate ranks if the totals are the same for different names

For your second formula, are you sure those ranks are correct? I'd expect it to be like this?

Name Product Sales Desired Rank
Amy Apples 20 5
Amy Oranges 50 1
Amy Oranges 30 1
John Apples 10 2
John Apples 20 2
Patrick Grapes 30 2
Patrick Apples 25 4

Patrick/Grapes = 30 and John/Apples is 30 so those 2 would be tied 2nd while Patrick/Apples is then 4th with 25

If that isn't correct can you explain your logic for the ranks shown?