Returning the Max Index and Sum in Lookup

jamesbeale

New Member
Joined
Jan 10, 2018
Messages
2
Hi all,
I have a 2 column table which contains customer names and order values. As customers place more orders, they are added to the table, therefore I have multiple entries for each customer.
Can someone advise on how I can retrieve the customer name and cumulative total for that has the customer that has the highest cumulative value of all orders?

Example below, what I want to return is "Customer A - 900.00"

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Customer A[/TD]
[TD]100.00[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Customer B[/TD]
[TD]200.00[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Customer C[/TD]
[TD]300.00[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Customer A[/TD]
[TD]200.00[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Customer C[/TD]
[TD]50.00[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Customer A[/TD]
[TD]400.00[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Customer B[/TD]
[TD]100.00[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]Customer A[/TD]
[TD]200.00[/TD]
[/TR]
</tbody>[/TABLE]

Thanks.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Ok, got ya.

Here's one way.

in C1
=SUMIF(A$1:A$8,A1,B$1:B$8)
and copy down

in D1
=INDEX(A1:A8,MATCH(MAX(C$1:C$8),C$1:C$8,0),1)

in E1
MAX(C1:C8)

D1 and E1 contain Customer name and highest cumulative total.

I can't quickly see a way of doing this in one go.

Something you should consider too:
What happens if there's more than one customer with the highest cumulative total?
This solution will only list the first one.
 
Upvote 0

Forum statistics

Threads
1,225,733
Messages
6,186,705
Members
453,369
Latest member
positivemind

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