Is there a better way to do this (Excel) - 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,

Related

Sort and find Top and Bottom 5 values and their corresponding names

I know this is not the first time someone is asking a similar question, but me trying to execute what I found out in other answers is not working exactly as how I want it to be. I hope someone here could help me.
I got four columns, the first one is the Product Name, and the last one is its P/L%. I want to sort out top and bottom 5 P/L% value along with their corresponding Product Name. I am attaching the screenshot of a sample scenario in case if you couldn't understand what I explained.
I tried the (sort(filter)) method as found somewhere else, but it actually messed up with the second and third columns. I hope someone here can give me some simple ways.
My solution considers the case when multiple products has same value in P/L% and I use a Table object for displayed data.
Formulas to use
Top 5 Gainers values
=LARGE(ProductTable[P/L%]; ROWS($H$3:H3)), and copy down
Top 5 Gainer values
Top 5 Gainers products name
=INDEX(ProductTable[Product Name];AGGREGATE(14;6;(ROW(ProductTable[P/L%])-ROW(D$2)+1)/(ProductTable[P/L%]=H3);COUNTIF($H$3:H3;H3))), and copy down
Top 5 Gainers products name
Top 5 Loosers values
=SMALL(ProductTable[P/L%];ROWS($H$3:H3)), and copy down
Top 5 Loosers values
Top 5 Loosers products name
=INDEX(ProductTable[Product Name];AGGREGATE(14;6;(ROW(ProductTable[P/L%])-ROW(D$2)+1)/(ProductTable[P/L%]=K3);COUNTIF($K$3:K3;K3))), and copy down
Top 5 Loosers products name
Short Explanation
You must use LARGE and SMALL functions when you want to get the largest or the smallest value in a data array.
AGGREGATE function is a little bit complex to explain here so I recommend you this link to understand better. Basically, I use this formula to get the row of the gainer or looser product name into INDEX function.
ROWS($H$3:H3) returns 1, but when you copy down this formula, you get 2, 3, and so on. This is a nice way to expand the query if you need more than top 5 values.
Similar problem in:
https://www.excelforum.com/excel-formulas-and-functions/1208726-index-match-large-and-duplicates.html

SUMIF with Index and multiple match criteria with Dynamic range

enter image description here
In the above problem, I am trying to create a dashboard of Brands Category wise.
The formula i am trying is. THis is in google sheets.
=INDEX($A$1:$F6,ArrayFormula(MATCH(A$12&B12,$A$1:$A6&$B$1:$B6,0)),Match(to_text(C$11),$A$2:$F$2,0))
THis returns only 1 value . But I would like to get a sum of BrandA, Catgory1 both in Nos and Pcs. How do I go about doing it? Somehow, not able to work with SUMIF. what is best suited?
Actually trying to create a dashboard for Month wise Sales/Purchase data like the link below. Any better way of doing in?
https://docs.google.com/spreadsheets/d/1047uWOrOqkW3L_1hoKh-MaY-O0_CZC0WiqmV8HZqk6o/edit?usp=sharing
Raj, if I understand your question, the following formula might provide the result you want.
=QUERY(Data!A1:F,"select A,B,sum(D),sum(E),sum(F)
where A<>'' group by A,B order by A,B
label sum(D) 'Apr',sum(E) 'May',sum(F) 'June' ",1)
This queries your data, groups it (and sorts) by brand and category (ignoring the Unit type) and sums the values. It also modifies the header text for the three summed columns.

Outputting text values

I am unsure Excel would be able to do this automatically. I hope it can but maybe not.
I am trying to work with another member of staff in a different building. I have created a table trying to identify where the flow of some of the work is coming from. I am looking to try and count the amount of instances of text within a column. The problem is that the text can be pretty dynamic. As an example:
Consultant
a
a
b
a
b
a
b
z
c
c
c
Is there a way I can get excel to count the instances of text within the column, then create a table with the totals of the counts in it with labels.
I looked at pivot tables and that didn't seem to want to play ball.
The simplest way to do this is using COUINTIF
=COUNTIF(A:A,"a")
Which will simply tell you how many times "a" appears in the Column A.
You could easily duplicate this for every letter of the alphabet. Then use a summary table to display the results.

How to show most sold part numbers

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... .

How to get total of top 10 sales in SSRS 2012

I am taking Top 10 of Sales Volume grouped by Product categories in SSRS 2012.
I need the total of these top 10 but it shows the complete total. I cant do it on dataset level as I need the complete dataset for other parts in the report. I tried the solution as given in MSDNlink but that didn't help either. Thanks in advance.
This sort of approach does actually work very well.
You haven't given any idea of what your data/metadata is like, but the concepts can be explained with a simple example. Consider the following data:
We will make a simple report based on this, grouped by the grp column:
Sort the groups by total val, from highest to lowest:
To get the running rank and the running total, we use the RunningValue function.
To get the Group Rank, use:
=RunningValue(Fields!grp.Value, CountDistinct, Nothing)
To get the running total use:
=RunningValue(Fields!val.Value, Sum, Nothing)
Finally, we need to display a total for the Top N values; in this case I'm displaying the top 2.
For the second group detail row, use the following Row Visibility expression:
=IIf(RunningValue(Fields!grp.Value, CountDistinct, Nothing) = 2, false, true)
That is, only display this row when there have been two groups, i.e. top 2. You could change the value as required.
This shows us one total row as required:
You need to apply these concepts to your data. If you're still having issues, I suggest trying to replicate my results with the above data/code to make sure you understand all the concepts involved.
Edit after comment:
For situations where there are fewer than N groups but you still want to display the last total, you need to add an extra check to the Top N row Row Visibility expression, something like:
=IIf(RunningValue(Fields!grp.Value, CountDistinct, Nothing) = 10
or (RunningValue(Fields!grp.Value, CountDistinct, Nothing) = CountDistinct(Fields!grp.Value, "DataSet1") and CountDistinct(Fields!grp.Value, "DataSet1") < 10)
, false
, true)
So now the expression will show the for the 10th row, or if the total number of groups in the DataSet are less than 10, it will show for the last group row.
It's a bit more complicated but it has worked for me in the past; depending on your data and report setup you might need to play around with the Scope a bit to get it working in your environment.
If you just need a total for those top 10 and not a running total, you can filter your table by top N ProductCategory and sort your ProductCategory group by SalesVolume Z to A.
For example, I have a table of sales orders and subtotals. I'm showing the top 10 highest total
I sorted by SalesOrderID group descending by my value (TotalDue). Then I filtered my table so it shows only top 10 SalesOrderID.
If you have a lot of data, you may have to see how this performs since I think the table filter happens at runtime.
I think I found an easy way to do that. I had many "Sums" in my report and I couldn't understand the way you answered.
The way i found was to create a parent group of the Details group and add a total row outside the Details. Then I hided the Detais group and the total group just did the Sums and in the group properties just needed to filter the final Sum top N rows, and sort by Z to A the Sum.
All of this worked fine and was done in the Group Properties! In the tablix poperties only showed 3 or 4 rows...

Resources