OR filter between table columns - excel

Is there a way to filter Excel tables similar to how Access queries can filter fields with OR operators?
E.g. I have the following table:
I want to list all items with the Messis aspect. In Access, one would make a query with Messis OR Messis OR Messis.. each in the following line or with OR in between. I would like to do something similar in Excel...

If I understand your question correctly, you want to find the row(s) where text X appears in any one of several columns. To do this, consider adding a column that is the concatenation of each column. Then use the column filter to select rows that contain text X.
An example:
For Column 6:
Results in:
Alternate answer
If, on the other hand, you want the OR statement for a single column, you can use the OR feature of the AutoFilter. If that doesn't appeal to you, you can use add a range outside of the table that includes has the text of a column in its first cell. Put the possible text options in the cells immediately below. Here's a picture:
Then, with the cursor in your table, click on Data, Advanced and complete the dialog box as shown.
Click on OK to see:

Related

Excel Filter(Filter()) Function. Filtering an array by columns and by rows based on dropdown selection

I have a table consisting of multiple rows and 7 columns. Many of the cells are empty.
I would like to create a summary table from that table, in which I filter for 2 columns using the Filter() function. Then the third column is filtered from a dropdown menu. I manage to get that using:
FILTER(Table1;((Table1[#Headers]="Checklist Item 1")+(Table1[#Headers]="Responsible")+(Table1[#Headers]=Q6)))
where Q6 is my column dropdown.
Now the summary table is a dynamic array, all nice and good, but it contains all the blanks.
Now I would like to remove all the blanks. I manage to do that, if I nest the Filter function in another Filter function, that filters for rows, like this:
=FILTER(
(FILTER(Table1;((Table1[#Headers]="Checklist Item 1")+(Table1[#Headers]="Responsible")+(Table1[#Headers]=Q6))));
Table1[S]<>"")
But I hard-coded the last filter part here where I filter for Table1[S]<>"". Instead of hard coding that one, I would like pick the column to filter from from a drop down in cell Q6. Something like Table1["column chosen in Q6"]<>"" but I cant get the syntax right.
Any ideas? I've been hard stuck for quite a while. Thank you.
Example image in below link
(note, my Excel uses semicolon instead of comma for argument separation)
See Example Image

Making excel search using one letter in cell

So basically, I have been trying to make excel scan one column and print out the row for cells which have specific letters.
For example I have the following data in my sheet.
What is required is to be have excel search for the values which contain T and I, and then print the new rows. Kind of like separate the two into two different tables, because then so that I can do further analysis on them.
So far I have been trying to use the VLOOKUP() function, but the problem with VLOOKUP() is that excel required a proper match and not just a letter in the cell. I had tried with both FALSE and TRUE. Then instead I tried to use the =INDEX($B$4:$K$9;MATCH($A$17;$A$5:$A$9;0);COLUMN(A4)) to make it work. But that also does not work, since it also requires a full match. Also another problem which I didn't realise before is that how can excel recognise each cell, because I will have different number after the letters everytime and then so how can one make excel not repeat the same row twice?
I have used another approach where I copy the data in a separated sheet and then I simply filter out the Ts and then copy/paste the Is into another sheet and vice versa. it is time consuming and so it would be much better if I can simply copy/paste my new data and it would generate the division on its own.
any suggestions or link would be really helpful.
UPDATE
I had a new idea on how to approach this problem. I was thinking that is it somehow possible to have VBA code running for filtering the data. Is there a way to specify in VBA code to filter the data by "Starts With" and Make the results be printed in another cell block?
Looks simple enough. First step is to make sure you have headers over your data and that it is in proper table format similar to my picture. Then select Data set and press CTRL+T. That should turn you data in to table object with stripes. Use the Formula =LEFT(C2,1) to take out the first letter which will be L or T.
Select the table and press ALT+D+P which will generate a pivot table based off original data set.
Drag the column with the formula I suggested over to the FILTERS area of the pivot table ID column to ROWS and all others to VALUES. Simply refresh and as new data is added you will get new pivot tables. Do not put the pivot tables on top of each other as I did that is only for the picture so you can see it. If you have too many filters to apply you can right click the helper column in the pivot table fields area to produce a slicer which is a button that helps you change the report quickly. Any other questions do ask.

Excel formula for counting the number of incidents of a word in a column?

Is there a quicker way of searching for terms without typing each one into the formula? Like, say I have a column that has a bunch of names of locations and I want to find out how many times each one comes up.
This is the formula for when I type in the locations:
=COUNTIF($F$2:$F$274,"*AD library*")
I just modify the AD library to the next one, say monastery so it would be
=COUNTIF($F$2:$F$274,"*monastery*")
Is there another way of getting the same info without having to type in each one (it's a big sheet with a lot of locations).
Thanks
use PivotTable on just that one column. Put that column in both rows and Values:
Go to the insert tab and insert a pivot table.
Then drag the header (locations?) you want the count of to row labels and any other header to the value field (preferably something with text).
Now the pivot should give you the count of each item.
If you don't have a column with text then choose any other and you need to switch from sum to count in the value field settings.

Pull a list of names assigned to a specified trainer in Excel

I want to pull a list of people assigned to a particular trainer. In column A I have the trainer name, In column B the Last Name, In Column C the First name. I'd like a list in a different column which sorts the names under the name of their trainer. I've attached a picture of what I'd like. I typed in the information manually, so don't be fooled into thinking that I've already got what I want. I'm thinking that I might need to use Vlookup, but I'm not sure that's right or exactly how to do it in this case.
Thanks!
Here's the array formula to go into cell N2:
=IFERROR(INDEX(Table1[[#All],[Full Name]],SMALL(IF(Table1[[#All],[Trainer]]=N$1,ROW(Table1[[#All],[Trainer]])),ROW()-1)),"")
For this to work, you need to:
First turn your data into a table. Click any cell in your data then click on Insert > Table.
Copy the formula, then double click into cell N2, paste the formula and instead of pressing just Enter to save the formula, you need to press CTRL+SHIFT+ENTER. If saved correctly the formula will appear with {Curly Braces} in the formula
Fill the formula down enough rows to include all trainees. Then fill the formula across the columns for the other trainers.
It can be done a few ways:
Repeated applications of the Advanced Filter that saves the results to different locations. This is tedious to update.
Write VBA. This takes a while to learn.
Use an array formula. This is complicated to understand.
Use a Pivot Table. Doesn't give the exact layout you want, but is very simple to create and to update.
I'd suggest trying the Pivot Table using following steps:
Click on a cell in your data.
Insert > Table (using a table means the Pivot Table with automatically include all new lines added to your data)
Insert > Pivot Table and click OK
Add Trainer to Row Labels
Then Add Full Name to Row Labels
You can adjust layout if you want from the Pivot Table Tools > Design tab. I prefer changing Report Layout to "Show in Tabular Form" and changing Subtotals to "Do Not Show Subtotals"
After adding new rows to your table, right click on the Pivot Table and select Refresh.

Excel: How to analyze cells with multiple values?

i have a table with a column NeedSegment containing cells with values like the followings:
OEMrs;#Partners;#Balancers;#DoItYourselfers;#Savers
OEMrs;#Partners;#Balancers
Savers
A different column is named Portfolio and contains normal single values.
In the end I would like to have a chart which displays per Portfolio how many rows have a specific needsegment e.g. Partners.
I've tried already with consolidated multiple pivot tables (Label contains) or countifs. But it seems to me far too complex...
Any advice or is additional information needed?
I can't see an easy way to deal with this without splitting first the data with the ; semicolon separator.
First of all, split your data:
Highlight all of your cells with the data:
Select the topmost cell in the column, e.g. A1
Hold CTRL+SHIFT and then press the down arrow.
OK, once we've done that, go to "Data" menu and select "Text to Columns".
On the Text to Columns window, select "Delimited" and then click "Next".
In the following window, choose both "Semicolon" and "Other" under Delimiters, and type # in the box next to "Other".
Check the box labeled "Treat consecutive delimiters as one".
Click Finish.
Source
Note: you could also do this with formula (but that would be a pain in the ass, except if you already know how many values there can be surrounding the semicolon)
Note2: you could also do this with VBA if you needed to repeat it several times
Secondly, you can build a Pivot Graph as described in ozgrid
[EDIT] Another solution - with formulas
What you can do if you only want to count the number of NeedSegments per value is to use this formula :
=SUMPRODUCT(IF(FIND("#Partners",A2:A20)>0,1,0))
You can refer to another cell to get the result for each NeedSegment:
=SUMPRODUCT(IF(FIND(B1,$A$2:$A$20)>0,1,0))

Resources