Multiple Criteria Filtering - Assigning Values for multiple rows - excel

First off, I am not sure if what I want can be accomplished this way.
Please refer the image attached.
So there are 5 journal entries. 3 of them have a debit & a credit leg, 1 of them has 3 legs & 1 has 4 legs. Now, the 5 entries have a single unique "Voucher Name".
What I exactly want is, if I filter "Cash" from Particulars column, by default in excel, I get the rows 2,4.
But what I want is when I filter "Cash", the entire journal entries with "Voucher code" which contains Cash must appear filtered. That is to say, rows 2,3,4,5 have to get filtered.
how do I do this??
PS: Pivot did not work.
I have data which is of 30000 line items.
SO manual work is not possible.

I have a solution that will remove the data you're not interested in, but I couldn't get the default filtering to work (this will not "compress" the table). Therefore, the data will still be scattered across 30,000 rows. However, it will allow you to perform statistical analysis on the data of interest.
Assuming your original picture from above (copied in case it changes):
Put the Particulars value you would like to filter (i.e. "Cash", "TDS", etc) in G1. Now put the following array formula (ctrl+shift+enter) in G2:
=INDEX($C$2:$C$8,SMALL(IF($B$2:$B$8=$G$1,ROW($B$2:$B$8)-ROW($B$1),""),ROWS(G$2:G2)))
I obviously only used the first 8 rows of your data, so you'll have to expand. Then, put this formula in H2:L2 (referencing A2:E2):
=IF(COUNTIF($G$2:$G$8,$C2)>0,A2,"")
Now, drag H2:L2 down to the bottom of your dataset. When you supply one Particular in G1 the formulas you dragged should only show that in which you're interested. You'd have to expand on this concept for multiple Particulars, but I hope this answer will suffice.

Related

Excel : Copy muitple columns to rows based on one column

I'm looking for the most efficient approach to transferring information from three columns to one row, right next to each other depending on the company name.
Consider the following example:
I have a 226k data list with product details for several customers (around 30-40k).
One customer can have 2 to 50 products, each with a serial number and a product number. Check out the source data pic.
Output required: One row per customer will have all the product data, serial number, and product number next to each other.
Source data
desired output
I have never used Macro. Can someone please help me find the best way to deal with this issue?
This one is pretty tricky, you'll need to play with column numbers to adjust formula:
The customer list in column F must be typed manually or if you have Excel 365 you may benefit from UNIQUE Function. I did it manually.
My formula in cell G2 is an array formula (must be entered pressing SHIFT+CTRL+ENTER or it won't work!
=IFERROR(INDEX(SI($D$2:$D$14=$F2;CHOOSE(COLUMN()-6-INTEGER((COLUMN()-7)/3)*3;$A$2:$A$14;$B$2:$B$14;$C$2:$C$14);"");MATCH($F2;$D$2:$D$14;0)+INTEGER((COLUMN()-7)/3));"")
Drag to right and then drag to down.
My formula uses the value 6 and 7 because my data starts at column G, that means column number 7. So if you put this somewhere else, make sure you change also 7 and 6 values to the proper values!
Anyways, I've uploaded a sample to Gdrive in case you want to check the formulas by yourself.
https://docs.google.com/spreadsheets/d/1TvNUVt0ArzyFK_jsRtZfX1ja2zUgSdhR/edit?usp=sharing&ouid=114417674018837700466&rtpof=true&sd=true

How can I make a drop down list in Excel 2013 based on several conditions?

What I would like to achieve is that sellers can choose the STORE in the blue cell (either with a drop down list or by hard-typing the STORE name) and, based on the selection on the blue cell, the available POSITIONS for that particular PRODUCT and that particular STORE are show in the green cell as a drop down list.
Let's say I have an Excel workbook, which contains a worksheet with this table with products data, which is automatically imported daily from our Nav server with this layout. It has 4 columns including PRODUCT CODE, DESCRIPTION, STORE IN WHICH IT CAN BE LOCATED and POSITION INSIDE DE STORE (please, check screenshot). It contains 1.5k rows and it changes dynamically, for example, new items are added or positions are exchanged.
As you can see, the same product (PRODUCT 2) can be located in several stores (STORES 1, 2 and 3), and it can be in several locations on each store (POSITIONS 2, 3, 1 and 4).
Now I need sellers to report which of these items they pick and from where, not only the STORE but its POSITION inside the store too. They do it with another worksheet inside the same Excel workbook. It looks more or less like this (please, check screenshot).
I know the drop down list is achieved via Data Validation but I can't figure out the formula for this. I have tried several approaches like:
Array formula to return all POSITIONS in the same ROW, following this (Formula 2.): https://www.ablebits.com/office-addins-blog/2017/02/22/vlookup-multiple-values-excel/. It is quite slow to calculate on the 1.5k items and, once done, I can't figure out how to make Data Validation to look for the 4 or 5 or 10 POSITIONS returned by the array formula, which also need to be filtered by STORE (please, check screenshot for the closest that I have been, array formula returning POSITIONS from column E).
Same formula as above directly on the Data Validation list box, which returns only the first POSITION found.
VBA custom fucntions which are not allowed in the Data Validation box.
I feel comfortable with both Power Query and VBA, and forumla as well, and can adapt most of the code I see but I don't know why I just can't figure out how to achieve this, maybe it is only I am blocked or something but every path I start to follow ends up in a dead end.
Does anyone have an idea on how to approach this? It doesn't really seem that complicated but it is becoming impossible for me.
Thank you very much for your time!!
This is what I have finally done, just in case someone else is facing this situation.
Instead of a plain-text table for the POSITIONS, I created a PowerQuery importing that CSV. Named that worksheet _LOCATIONS.
Added a custom column (Column E) combining the PRODUCT and the STORE so I had something like a Unique Identificator, resulting something like this but in PowerQuery.
Combined column:
Sorted column E and sub-sorted column D, so I make sure the list will always be ordered as I need, and saved the query.
Then, in worksheet REPORT, I entered this formula to create the drop down list in Data Validation in cell D2:
OFFSET(_LOCATIONS!$D$1,MATCH($A2&"-"&$C2,_LOCATIONS!$E:$E,0)-1,0,COUNTIF(_LOCATIONS!$E:$E,$A2&"-"&$C2))
And I am able to choose from the available POSITIONS for the selected PRODUCT in the selected STORE.
Brief explanation:
I set the reference for the OFFSET function in the very first POSITION (D1), and then I move it the amount of rows detected by the MATCH function (which searches for the "PRODUCT 2-STORE 2" string in the newly created combined column) minus 1 (PoweryQuery table has headers) and 0 columns. This leaves me on the first occurrence of my string (but on the POSITIONS column). Then I make the offset as high as the amount of rows detected by the COUNTIF function (which counts all occurrences of my PRODUCT-STORE pair), returning an array of all the positions (column D) matching the PRODUCT-STORE pair.
Ask for formula in Spanish if you need it.

VLOOKUP to bring data from another sheet

I have a table containing a some football data, such as Country, League, Teams, Standing table information, such as total matches played, wins, draws, losses, goals scored and conceded, and so on.
Here's a file download link
It contains two sheets.
First sheet is STANDINGS_EXTENDED:
I need to fill these 3 tables with the data contained in another STANDINGS worksheet.
Here's a screenshot of the STANDINGS sheet:
My aim is that once I fill LeagueId and Group Id (which is optional) fields then inside all three tables will be produced the data as in this sample.
I wonder if it is possible to achieve this without VBA. But i have no clue on where to start from. I tried is several different ways, but i get only first result from STANDINGS worksheet for any league i enter.
Looking forward to your help.
Thank you!
UPDATE:
So far I could get the count of rows related to Overall, Home and Away using these formulas:
=COUNTIFS(STANDINGS!E:E;STANDINGS_EXTENDED!E1;STANDINGS!F:F;"StandingsOverall")
=COUNTIFS(STANDINGS!E:E;STANDINGS_EXTENDED!$E$1;STANDINGS!F:F;"StandingsHome")
=COUNTIFS(STANDINGS!E:E;STANDINGS_EXTENDED!$E$1;STANDINGS!F:F;"StandingsAway")
Also, what I can get is the first row of these results using this formula:
=VLOOKUP($E$1;STANDINGS!$E:$V;4;FALSE)
What I need to figure out is how to modify above formulas so that I fill tables with remaining rows.
In order to do this you need a formula in every single field of your 3 tables that link it to data on the Standings tab. That would be 13 x 3 x 20 formulas. Therefore one would try to create formulas that can be copied, in the best case less than 13 original ones, but definitely one formula for each field.
Each formula would look for a unique identifier in the Standings list. I can't see any unique identifiers there but you might create them by concatenation, such as "League" + "Country" + "Position". The more detail you need the larger the formula. The key is: without a unique identifier for each row you can't retrieve data. But once a row has been identified you can get the value from any of its columns.
If your tables sometimes have 12 rows, sometimes 20, and sometimes 25 you must provide space for the possible maximum and then design your formulas to return a blank if there is nothing to display.
In conclusion, the core of your system is in the Standings table. It must be set up so that data can be retrieved from it. Ideally, your selection on the Standings Extended sheet would generate a concatenated unique identifier for a list to which you can add the fixed number in the Pos column to identify individual rows in the Standing table. As long as you can't identify rows no data can be retrieved.
Using VBA gives you more flexibility but doesn't relieve you of the task to create uniquely identifiable rows.

Tableau: hide table calculation for only one column

I'm working on a visualization in Tableau, regarding numbers for actual figures, budgets, and estimates. For budget and estimate, I also want to show the percentage of difference compared to the actual. I have these numbers for several categories.
I recreated an example as below.
What I now want is: Hide the percentage calculation ONLY for the actuals column.
I tried several things. but it always ends in multiple columns being deleted. How can I do this?
(Percentages are calculated across table and based on "actual" scenario).
Edit 1: As in one of the answers, creating seperate calculated fields for each value is an option. But in my problem, I will have a lot of measures where I want to disply it this way. So creating 5 calculated fields for every measure is really a last option.
Also: I now solve it using 2 different sheets on the dashboard. One sheet with actual numbers, and one sheet with percentages (hiding the actual column). But then the line up is not so nice, and also when the sorting of the dimension changes, it is tricky. I have also options to drill down the hierarchy of a dimension, and with two sheets, one of the two will of course not adapt then.
Currently you are using F1 for rows and F2 for columns and measures that will split to as many values as F2 has (Currently their are 3 columns).
Solution that I can think of in this particular case is to remove F2 from columns part and create 5 formulas for the measures.
Actual Sum // Since we don't want Acutal (%diff) we won't create that formula
Budget sum
Budget (%Diff)
Estimate Sum
Estimate (%Diff)
Now formula will be like
If F2 = "Actual" //Same goes for Budget and Estimate
Then f3
End
Take one more sheet now add the quick table calculation for difference for Budget and Estimate and add those to Formula fields.
Now place all 5 formulas in columns part, So you have your measures.
To add the column headings you can use dashboard, Add the sheet to dashboard and manually add texts to the measures that will look like the one you have attached in screen shot.
I have implemented a sample using Sample super store and attaching the screenshot for the same.

Transpose multiple rows into columns

I've came across this task and I'm stuck big time. I've tried a PivotTable but it didn't give me the desired result. The only thing that works is a manual transpose but the number of records is 5k odd.
What I'm trying to achieve here is to transpose the data from rows for the company into columns so at a later stage to be able to count the number of votes and average per company.
PivotTable can do the job. All you need is a helper column using COUNTIFS. Notice the formula in cell D2.
And the PivotTable would look like this (set to Tabular Layout)
A note to take here is COUNTIFS can get really slow when the number of records grow to around 10k or more (or just my slow pc :/). When this happens, the workaround is: first sort your data, then use COUNTIFS over a limited number of cells only. For example, at cell D2, the formula will be =COUNTIFS(A2:A102,A2,B2:B102,B2), hence counting only 100 records rather than the whole bunch as you fill down the formula.
If what you want is the number of votes and average per company, that can be done in a variety of ways.
Using a Pivot Table, drag companies to the rows area; drag rating to the values area twice. Then change the Value Field setting on one of the Ratings to Count; and on the other to Average.
Add some formatting and various options gives you:
Or if you have a list of the Organizations (Company Names) in, let us say, G3:Gn, and your data table in columns A:C, you can use formulas:
Count: H3: =COUNTIF($B$1:$B$1000,G3)
Average: I3: =AVERAGEIF($B$1:$B$1000,G3,C1:$C$1000)
And fill down as far as needed.
Since you mentioned a PT did not suit , assuming RATING is in F2, please try in G3 copied down to suit:
=IF(AND(COLUMN()-7<COUNTIF($E:$E,$E3),$E2<>$E3),OFFSET($F3,COLUMN()-7,0),"")
then drag all the formulae to the right until an entire column appears blank. Note this requires the TARGET ATTENDEE ORGANIZATION column be sorted.

Resources