Searching multiple columns for multiple matches, based on multiple search criteria - excel-formula

1I've been using an INDEX formula to search for results across several columns of data. However the formula's I have (although working ok), are getting extremely large due to the file path of where the data is stored; so i'm looking for any way to 'shrink' the formulas.
=IFERROR(INDEX($A$1:$M$12,SMALL(IF(((($B$2:$B$12="All Pages")+($B$2:$B$12="Page A")+($C$2:$C$12="Page A")+($D$2:$D$12="Page A"))*(($F$2:$F$12=E14)+($F$2:$F$12="All Towns")+($G$2:$G$12=E14)+($H$2:$H$12=E14))*(($J$2:$J$12="All Sectors")+($K$2:$K$12="All Sectors")+($L$2:$L$12="All Sectors")+($J$2:$J$12=I14)+($K$2:$K$12=I14)+($L$2:$L$12=I14))),ROW($M$2:$M$12)),ROW($M$2:$M$12)-1),13),"")
Is it possible to search the Concatenate'd columns i.e Column A; instead of having to search B,C, & D seperately?

Related

Excel: =COUNTIF or =COUNTIFS referencing a range as their criteria

I have used a macro to get me a list of around 600,000 files (hosted on a server) that are then listed into an Excel sheet. From this list, I need to know how many DON'T meet a certain criteria and I have a few different statistics being calculated based on the files and their types (PNG, JPG, .DOC, PDF, etc). What I'm calculating or excluding from this list is changing often depending on what data I'm analyzing from this list. So that I don't have to constantly update a formula with a list of exclusions from this list, I'm trying to write a function that will just exclude a list in another column.
My current solution is a simple =COUNTIFS(A:A,{"<>","<>JPEG File","<>Outlook File", etc}). The "<>" is there because it keeps counting blank cells after the list if it is not included. I want to actually replace the COUNTIFS criteria part with a list of items in another column. I tried =COUNTIF(A:A,"<>"&C:C) and this doesn't work, but is returning a value equivalent to COUNTA, not actually excluding the items in the C column that I add (I think it's function in an AND capacity for the criteria and not as an OR). I tried doing a =COUNTA(A:A)-COUNTIF(A:A, C:C) but again, COUNTIF seems to be counting C:C as a list of AND criteria and not ORs.
The ideal would be if this actually worked: =COUNTIFS(A:A, "<>", A:A, "<>C:C") except that COUNTIFS doesn't allow a range as a criteria, so this obviously can't work.
Is there another solution that I'm just not seeing? Knowing myself, I wouldn't be surprised if it was actually super obvious and something I should have seen or I'm just misunderstanding something here.
=SUMPRODUCT(--(ISNA(MATCH(A:A,C:C,0))))-COUNTIF(A:A,"")
Where A:A is dataset and C:C is list to exclude. Example:

How to create partial string search function in Excel looking across entire Array

I'm trying to create a Search response in Excel to look for a partial string in what could be a paragraph. This will then return the location of that cell to determine the row needed to pull the data from. I have tried many different ways including Index Match to process this but the formula is either pulling the wrong data or giving me a #N/A from this first function to verify it is collecting the right pieces:
=INDEX(Sheet15!D:D, MATCH("*AS5553*", Sheet15!E:E, 0))
This is trying to force the data to only search Column E for a match but both E and F contain the information we might need. All data is currently stored in Table1.
Is it possible to create a search function with nested IF loops for both columns without writing VBA?
Edit - Adding an example table. The idea would be to search for Medditerranean and it would return the first result. There are repeat strings in the text it will need to navigate.

Excel advanced filter not showing results

Trying to put an advanced filter on an imported data list and copy to new sheet.
It only seems to either show everything in results or nothing except headers. I'm sure this is to do with my criteria, but I have tried every permutation I can think of (short of using VBA as I'm not competent with it), but nothing seems to yield actionable results.
If someone could have a look at the screenshots below and provide some direction I'd be most grateful.
The headers for the criteria are directly copied from the table headers and I've tried by separating the OR formulas into descending cells in the same column. Maybe it's to do with the syntax of the formulas I'm using, but I was informed by multiple sources online to have a formula that always returns a Boolean result and to have it tied to the first data in the worksheet that I want sorted (hence the B2, K2, O2, etc.).
Teylyn:
I was using this format for the criteria before, but it gave the same results - nothing at all!
criteria 2
Just tried again with the above criteria and no results again.
Additionally have tried with the following criteria - same again.
criteria 3
I need it to filter for every permutation of criteria columns 1, 2 & 3, hence the OR formulas being used before - I thought it might be filtering for AND all first row criteria, OR, AND all second row criteria.
I've even gone so far as to format all criteria such that it searches for first column (B2<=TODAY()-3) AND 2nd column AND 3rd column (O2="Not booked") then underneath, to imply OR, 1st column (B2<=TODAY()-3) AND 2nd column AND 3rd column (O2="Sent"). Setting out each permutation in this tiresome fashion. Still no results.
I can send you a dropbox link to the file if it will help.
You are not using Advanced filter correctly. It does not work with formulas like the ones you enter. You put one condition per cell, not a formula with OR().
Take a look at the documentation:
https://support.office.com/en-us/article/filter-by-using-advanced-criteria-4c9222fe-8529-4cd7-a898-3f16abdff32b#bkmk_5
or here:
https://www.techrepublic.com/blog/microsoft-office/how-to-use-and-and-or-operators-with-excels-advanced-filter/

Display value if text strings from two ranges match

I have two worksheets in Excel. One contains the rankings:
:
The other one the matchups (daily updated automatically)
The purpose is to display the rank of each respective team in two columns next to the matchups. One of the problems is that the text strings are not exact matches (limitation of the webquery).
So I need to find a formula for when there is a string of the table in Rankings that approximately matches the specified cell for the team in matchups and then display Rank (column 1 on Rankings) next to it.
So far I've got this in the cell where the ranking is supposed to go.
=VLOOKUP("*"&qry!B5&"*";Sheet1!A3:C369;1;0)
But it just results in the string "rank" from the table header in Rankings.
Any ideas?
Several things:
Vlookup will try to find a match in the first column of the lookup table and can return a value from a column to the right. Your lookup table has the desired return value in the first column and the lookup values in the second column. Therefore, Vlookup will not work in this scenario. You can use a combination of Index and Match, though.
the * wildcard before and after the lookup value mean that the value in the lookup table can have any text before and after the text already in your lookup value. In your case, the lookup value has more text than the text in the lookup table. So the wildcard is not helping. Example: you have "353 Virginia" and you want to find this in a column that has only "Virginia". Wrapping "353 Virginia" in wildcards will add no value, because the text that you want to match is actually shorter than the text you are starting out with. You need to remove stuff from the lookup value instead of adding wild cards.
If the data for the rankings comes from a web query, you need to do some work to clean up that data, so it is fit for the lookup into your other table.
In addition to the number at the beginning, there are also two characters at the end of some cells that I cannot identify. These need to be stripped out, too, before you can do the lookup.
Assuming that all cells contain three digits and a space at the beginning you can use a formula approach
=TRIM(MID(SUBSTITUTE(B5;" ##";"");5;99))
Substitute will remove the trailing characters. I don't know what they are exactly, some web related special characters, so for the exercise here I have used ## instead of the A thing and the chevron. Copy and paste the web characters from one of your cells to the formula. With data coming from the web you may also want to check for leading and trailing white space, non-breaking space characters and other invisible characters.
You can use the "cleansing" formula as the basis of a lookup or, if the formula above sufficiently cleans the data, then you can use it in an index/match combo like this:
=index(Sheet1!$A$3:$A$369,match(TRIM(MID(SUBSTITUTE(B5;" ##";"");5;99));Sheet1!$B$3:$B$369;0))
Without seeing the actual data in a spreadsheet it is hard to tell if the formula cleanup is sufficient. You may need to do more work until a lookup returns the desired value.
If the data is coming from the web, I strongly suggest that you look into Power Query as a tool to get the data from the web into your spreadsheet. Power Query is a free add-in for Excel 2010 and 2013 and is built into Excl 2016 as "Get & Transform". It can connect to many data sources, including tables on a web page, and it has very powerful mechanisms to clean data for further processing. Once a Power Query is set up and working, all you need to do is refresh the query to load new data from the web site.

Cross table comparisons, sumproduct

I am trying to compare two different Excel (2010/xlsx) tables with related data to find matches. They would be on different sheets but in the same workbook (not that it should affect the problem).
I think the best route is some combination of sumproduct, match, and index... but I haven't been able to get them to work so far. I see the main question (cell G17) being solved by creating a subset of rows from Table 2 to compare against their corresponding data in Table 1 (index/match), then using arrays to do a multiple criteria selection to count how many match the criteria I chose (sumproduct).
I have played around with vlookup, countif(s), and sumif(s) but haven't seen a good way to apply them to this problem.
You can use SUMIF as a "quasi-lookup" like this
=SUMPRODUCT((file="doc")*(modified < SUMIF(user,creator,create)))
I'm not sure how to do it in a single cell as you've asked, but I would create an extra column in the second table which uses vlookup to find the created date, and another column containing whether or not the created date is greater than the modified date. Finally, you could use countif to combine them.
To be more concrete, in your example, I would put =vlookup(F3,A$3:D$5,2,FALSE) in cell I3, and =I3>H3 into cell J3, and expand both of these down. Then cell G17 could be given by =countif(J3:J5,TRUE).

Resources