Sorting, Filtering, and Counting Question

excelnoobaugust2017

New Member
Joined
Aug 5, 2017
Messages
2
Hi all,

I recently started using Excel and have been trying to solve a problem involve sorting and counting. I'm sure it's been encountered many times before, but am having trouble figuring it out. I tried searching for answers on the forums, but was having trouble putting my question into searches that yielded relevant results, so I thought I'd try posting my own question here.

Essentially I have a spreadsheet like the one below (albeit much longer!):

[TABLE="width: 500"]
<tbody>[TR]
[TD]Unique ID[/TD]
[TD]Person[/TD]
[TD]Food Bought[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Dylan[/TD]
[TD]Burger[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]Dylan[/TD]
[TD]Fries[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]Bill[/TD]
[TD]Burger[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]Bill[/TD]
[TD]Ice Cream[/TD]
[/TR]
[TR]
[TD]E[/TD]
[TD]Simon[/TD]
[TD]Burger[/TD]
[/TR]
[TR]
[TD]F[/TD]
[TD]Simon[/TD]
[TD]Burger[/TD]
[/TR]
[TR]
[TD]G[/TD]
[TD]Matt[/TD]
[TD]Fries[/TD]
[/TR]
</tbody>[/TABLE]

I'm trying to sort/filter the different people and count the "food" items they bought so that the data can be organized in a spreadsheet similar to the one below.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Person[/TD]
[TD]Burger[/TD]
[TD]Fries[/TD]
[TD]Ice Cream[/TD]
[/TR]
[TR]
[TD]Dylan[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Bill[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Simon[/TD]
[TD]2[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Matt[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]

If anyone has any tips/hints/suggestions for how I should go about approaching the problem, it would be much appreciated!

Thanks for the help!
ExcelNoobAugust2017
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Welcome to the MrExcel board!

Excel has a built-in feature (Pivot Table) to do exactly that sort of thing. You'll find it on the 'Insert' ribbon tab. Do some research on that and see how you go, but post back with any specific problems you have.
Here is the data and Pivot Table for your sample data

Excel Workbook
ABCDEFGHIJK
1Unique IDPersonFood BoughtCount of PersonFood Bought
2ADylanBurgerPersonBurgerFriesIce CreamGrand Total
3BDylanFriesBill112
4CBillBurgerDylan112
5DBillIce CreamMatt11
6ESimonBurgerSimon22
7FSimonBurgerGrand Total4217
8GMattFries
PT
 
Upvote 0
Hi Pete_SSs,

Thank you for the help, this was exactly what I was looking for to help point me in the right direction!

Best,
ExcelNoobAugust2017
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,274
Members
452,628
Latest member
dd2

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