Calculate total of items in a column

Jtyler

New Member
Joined
Mar 31, 2002
Messages
1
I have a spreadsheet of inventory items. I need to calculate how many have been used of each item number. All of the item numbers are listed in column A. They have been sorted. Example A2 to A6 is part #1234. A7 to A12 starts a different item number and so on…There are 2000 cells used in column A but only 55 different item numbers. Is there a way to put the total used of each part number into a cell in column B. Many Thanks for any suggestions.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
There are a number of ways to do this.

So, you've got a list from A2:A2001. If you know the 55 item numbers already, you can list them in C2:C56. In D2, write =countif($A$2:$A$2001,C2) which is basically telling Excel to look through the range A2:A2001 and count all the occurances of whatever is in C2 (FYI - the dollar signs keep the range from "moving" - notice that, with no dollar signs around the C2, as you copy down, it changes to C3, C4, C5...etc...without the dollar signs, your range would have changed A3:A2002, A4:2003, etc...sometimes you want that, but in this case, you don't).

Then, copy C2 in C3:C56 and you'll have a count of all the instances of each part number in your list.

Now, if you don't know what the 55 item numbers are, then we have to find the unique values in A2:A2001. Advanced filter can handle that.

On the menu, click on Data|Filter|Advanced Filter; hit the radio button for "Copy to another location"; then, in the list range, click the little button to the right, which will take you back to the sheet with the data we want to filter, select the column A and click on the little button in the right again; now in the "copy to" field, again click on the little box in the corner, and when you're back on your sheet, select column C and hit the corner button again taking you back to the filter dialogue box; finally, make sure to click on the "unique records only" check box; and hit ok.

Now, in column C, Excel has skimmed through your list of 2000 entries and copied only the unique instances of each.

So, in column D2, enter your countif formula, copy down to D55, and you're done.

There may be many more wonderful ways to do this, but for now, this will work, and at least you've learned something that might come in handy in other tasks.

_________________
Regards, Duane
This message was edited by Duane on 2002-04-01 17:11
This message was edited by Duane on 2002-04-01 17:11
 
Upvote 0

Forum statistics

Threads
1,214,391
Messages
6,119,244
Members
448,879
Latest member
VanGirl

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