How to show most sold part numbers - excel

I have large list of items sold and would like to be able to generate a report that shows the most sold items along with how many of each item has been sold.
I'm looking for something along the lines of =countif() but as there are so many unique part numbers I'm not sure how to do this.
To add to the confusion I'm making it so this report automatically generates by dumping the right info into certain worksheets and then running a macro written in vba.
Not asking for a step-by-step approach but maybe someone to point me in the right direction.
Thanks!
edit to show how data is organized:
PO# SO# Line Item Material# Description Order quantity Net Price Customer Created on
The same PO# and SO# will occur with multiple line items for each.

Create a PivotTable with Material# for ROWS and Sum of Order quantity for VALUES then filter for Top 10... .

Related

In Excel, how do I count the number of times a pair of phrases in Column B are associated with a unique ID in Column A?

Hoping this is something Excel can do. I work in a pharma lab, and have been assigned a task of totaling up the number of Freeze/Thaw cycles each sample/vial has gone through in our labs for a particular study. To do this, I exported a storage report from our database and pasted the pertinent info in a new worksheet, see below. Column A is a list of the barcoded labels adhered to each specimen. Column B is a list of the transfers each sample has gone through during its life cycle here.
What I am needing: the number of "Move to Thaw" / "Move to Freeze" (f/t cycles- one pair of move to thaw/move to freeze combos = 1 f/t cycle) associated with each Custom Id. Not all Custom IDs will have a F/T cycle, and some may have up to 7. All other transfer types are not important.
So....is this something Excel can do for me? There are 2000 lines in this workbook that I'd rather not go through line by line...so far, I tried filtering out all the other transfer types, but then the ones with NO f/t cycle are excluded.

Is there a better way to do this (Excel)

I have a dataset with 5 main categories and 26 subcodes. Each item falls under any one or more of the 5 categories and is assigned ~1-6 of the subcodes.
I'm taking the few thousand entries and breaking it down as shown below in the pictures.
Right now I am using filters to only show the items that have an "x" in the right columns and taking that data to a different tab where I use the =SUM(LEN(range)-LEN(SUBSTITUTE(range,"text","")))/LEN("text") to pull out a count of each subcode from column G. I'm mainly wondering if there's a quicker way to get around having to manually do the filter for each category combination.
Anybody got any ideas?
Thanks,

What to use: COUNTIF or Vlookup or combined or else?

I got a big data file where I have to count how many events is per one serial number (in my case P/N) through more sheets (years). Those serials are in Column A (grey). On second picture is lookup table, so the data from where I have to search and Count events looking at (Column O - yellow) and Column A (artikel), using terms from Column P for all the sheets, I mean through different year. All sheets are consistent and looking exact the same.
What I tried to do is: COUNTIFS(A2:A142;VLOOKUP(A2;'Spareparts 2015'!$A$2:$O$164;15;FALSE))+COUNTIF('Spareparts 2015'!O2:O164;"Ersatz im Rahmen einer Wartung") to look for specific term but this is not what I wanted.
Idea is to get all these specific "terms" using P/N through all years (summed), to see how many times serial number (P/N) has been used through years. And I need total number (of 5 years). As you see in main table there are more serials, and everything what is needed is some good positioned function which I cant get...
Hopefully I was clear with my issue, it is a bit hard to explain, but I eager to provide more infos!
UPDATE!
This is actually what I wanted to accomplish (with Pivots is possible)
For every Serial (artikel) that I have in Calculated sheet, I wanna look and count all instances (Grund fur ersatz in Column O) through years and different sheets. Every sheet has mixed serials, and these occurrences, so I have to couple them with main table and to count total number of them, how many times something from Column O appeared in some of Serials through 5 years.
One option is using Pivot tables actually, but I wanted to know how I can solve it with formulas also.
EDIT #2
Given that the relationship between each serial number and the look up term is 'Many to Many' but not 'One to One', one way to count the occurrence of each term for each serial number is to
Firstly put all 5 years of data into one big table, and name the following ranges:
Name_All being names in Column O of the master data table;
SN_All being serial numbers in Column A of the master data table.
Secondly, create a look up sheet to list all serial numbers and associated look up terms as shown below:
Then you can use COUNTIFS to count the occurrence for each term per serial number:
=COUNTIFS(SN_All,A2,Name_All,B2)
See following screen-shot for more clarifications.
A better/quicker approach would be using pivot table as being mentioned by OP.

multiple lines made into 1 line of data

I have attached a picture of what im trying to do.
I run these reports on my techs once a week. on the left side of the picture it shows the service order number multiple times and then the the booked date and closed date the techs id number actual hours work and then sold hours. the problem is it has many lines with the same service order. i need to make it look like the line to the right. 1 usable line of data so that i can process the reports the way i need to.
Copy A1:E32 all your Data without column F and paste it in I1 it will be I1:M32 for example, select I1:M32 the new Data under Data Tab click on Remove Duplicates you will have one row for each different entry
If the Number in Ro-no (column I) is unique for each entry, use the following in N2:
=Sumif($A$2:$A$32,I2,$F$2:$F$32)
and drag it down
It will sum the Sold Hours in column F for each RO-NO
Change the references to include all your rows and keep $
Power query
One of solutions is to use MS power query addin. In Office 2016 and alike the PQ is built-in feature, located on the Data tab, Get and Transform group.
Let's say we have data like this:
We can use the Power query to Group By, like so:
The query will remember the steps you 'teach' it.

Nested list in excel

I'm not even sure how to ask this.
I have a database, where each row is a person. Columns are contact info, phone, etc. One column is 'date visited'. There can be multiple dates visited for each person. I don't want to use a comma or stack them all in one field.
Is there a way to have a 'nested' list (not a drop-down menu - just a list of visited dates for each person), such that one person still only consumes one single row?
Yes,
To accomplish this give each person an ID that is unique and won't change.
Then on a separate sheet, store the ID and date.
main sheet ( ID, Name, Contact Info, phone, ect)
second sheet ( ID, date visited)
In database theory this is called a 'one to many' relationship, and what i'm describing is called 'normalizing your dataset'.
In Excel you can now use formulas to manipulate the data however you need to or can imagine after you split this apart.
As you mentioned in comment, counting all visited dates for a user.
On the main sheet to the right you could use:
=countif(Sheet2!A:A,Sheet1!A1)
This would Count all of the ID's in the second sheet that match the current row's ID on your main sheet.
Notes about using one cell:
Storing all the dates in one cell will eventually max it out, and will make it hard ot view/search as it grows so i highly advise against this approach.
If however you insist on keeping the dates in there, you could count the visits by counting the total number of comma's + 1 liek this =(LEN(G1) - LEN(SUBSTITUTE(G1,",","")))+1 This formula takes the length of all the dates, and the length of dates with commas removed and subtracts them to get a number of occurrences.
Notes about using multiple columns:
This approach has the same idea as the one I suggested, where we are associating a number of dates with the row's identity of a person. However, there are a few key limitations and drawbacks.
The main difference is that when we abstract the dates by transposing them to extend vertically we can manipulate them easier, and make a list of 20 dates for one person much easier to read. By transposing the dates vertically in the second sheet instead of using this approach we also gain the ability to use Excel's built in filter. Just storing large amounts of data is useless by itself. While storing it in a way that you can view and manipulate easy makes everything much more powerful.

Resources