Lookup a data set with multiple lines but return total value

snash

Board Regular
Joined
Jan 12, 2006
Messages
222
Hi there,
If I have a data set that contains customer names and product purchased with their price.
How can a do a lookup of that customer with the total amount purchased?

thanks
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
=SUMIF("Range with customer names", "Customer name or cell with customer name in it", "Range to sum")
1713792576752.png

1713792585500.png
 

Attachments

  • 1713792531829.png
    1713792531829.png
    14.5 KB · Views: 3
Upvote 0
What about if I have multiple lines and want to return the lines separately. As above, return each line item for Bob?
 
Upvote 0
Hello - you can use the FILTER function to extract all lines relating to Bob. Just create a data validation for the list of names and then enter the following formula;
=FILTER(Range (Excluding Headers), Then Highlight Name Range = Bob (On data validation drop down). This will extract all records for Bob only and should look like;

NameProductAmount
BobSnickers
1​
BobPear
2.5​
BobOrange
1​

As an alternative to SUMIF,you can enter SUM(FILTER(Range (Excluding Headers), Then Highlight Name Range = Bob (On data validation drop down) which will also give you the total for Bob.
 
Upvote 0

Forum statistics

Threads
1,216,072
Messages
6,128,632
Members
449,460
Latest member
jgharbawi

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