Naming ranges of cells based on type

kcin

Board Regular
Joined
Jun 6, 2006
Messages
118
Hello,

I am trying to create named lists of ranges of cells and I really have no idea how. Basically my worksheet is setup like this:

Product Price

Apple $0.50
Banana $0.25
BMW $30,000
Chevrolet $10,000
Orange $1.00
Volkswagon $20,000

Now I will be graphing this data as a bar chart and sort it in ascending or descending order. What I would like to do is "Categorize" each product into its own "group" and then be easily able to calculate the average price for each "group". Is there a way to select the cells "Apple" and "$0.50" and categorize them as "Fruit"? Then once I categorize all the "Fruit" I can use a simple formula such as =Average(Fruit) and it will give me the average price just for the fruit items?

Any help with this would be greatly appreciated, thanks.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Try using a new colomn (say C) to define, item by item, the Category; then you can either set an Autofilter on column C and use =SUBTOTAL(1,C2:C1000) to display the average price of the filtered items; or use a pivot table with Category in the Row area and "Average of price" in the Data area, and you will get a table with all the average prices; you will not see "Average of price" while setting the layout of the pivot table but, probably, "Count of.." or "Sum of..": just double click what you see and choose "Average" in the list that will be shown.

If you need assistance about creating the pivot table, just ask.

Bye.
 
Upvote 0
Yet another option, after adding the extra column, is to use an array formula (confirmed with Ctrl+Shift+Enter, not just Enter) as follows.

Excel Workbook
ABCDEF
1ProductPriceCategoryCategoryAverage
2Apple0.5FruitCar20,000.00
3Banana0.25FruitFruit0.58
4BMW30,000Car
5Chevrolet10,000Car
6Orange1Fruit
7Volkswagon20,000Car
Average by Category
 
Upvote 0

Forum statistics

Threads
1,214,589
Messages
6,120,416
Members
448,960
Latest member
AKSMITH

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