Trying to remove bad data using countif function - excel

First, thank you for the help in solving this problem. It's pretty simple but I'm just not getting it.
In excel, I have 2 tabs. In the first tab, I have rows of personel data (job title, country of business, Industry, etc.)
In the second tab, I have a column of prohibited titles. These are titles that don't match the criteria we want.
I'd like to create a formula that checks the rows in tab 1 against the prohibited titles in tab 2. If the data matches, I'd like it to return 'N' in column A, which signals that we should remove that row of data. Title information is found in row F on tab 1.
My various countif functions aren't working and I'm not sure why.
Various countif formulas, like
=COUNTIF(F:F,"'Bad Titles!'A:A")
Produces N for all titles we want to disregard

Use MATCH it is quicker:
=IF(ISNUMBER(MATCH(F2,'Bad Titles!'A:A,0)),"N","")
If the matches are partial then:
=IF(SUMPRODUCT(--ISNUMBER(SEARCH('Bad Titles!'$A$1:$A$100,F2))),"N","")

Related

COUNTIF across multiple cells based on criteria from another cell?

I've got a fairly large spreadsheet with survey data that I'm trying to summarize. The first tab of the spreadsheet has all the survey data and I'm trying to summarize on the second tab.
Column A in my second tab will have all the unique store numbers listed. I'd like Column B of the second tab to list the number of times a customer answered "Very Satisfied" in columns R through Z on the first tab for a particular store. The store number is also listed on the first tab in column DY.
I've never tried nesting combining COUNTIF and VLOOKUP before or maybe that's not even the best way to do this. My feeble attempt looks like this
=COUNTIF(Sheet1!DY:DY,VLOOKUP(A2,Sheet1!R:Z,0,FALSE))
And, of course, this returns "#VALUE!". I know I need "Very Satisfied" in there somewhere but I can't wrap my head around the nesting. Any suggestions? Thanks in advance.
Use SUMPRODUCT()
NOTE: I am using full columns here but it would work better if one would limit the references to just the rows that have data.
=SUMPRODUCT((Sheet1!DY:DY=A2)*(Sheet1!R:Z="Very Satisfied"))

Using VLOOKUP and not only match on first value

I'm trying to use VLOOKUP to match activities with product codes, but run into an issue since VLOOKUP always returns the first match. I did a mockup below to describe my issue. To the left, I have a table with activity names and product codes.
To the right, in column G, I want to, based on matching activity names in column F with activity names in column A, assign the activities product codes from column B.
When I use VLOOKUP, it only matches with the first activity name and give all the activities with the same name the same product codes. I need them to get different product codes even if they have the same name. I want my function to "take the next one" on the list, when the first one is taken.
Should I try to use another function to solve this? Is it impossible with VLOOKUP? My 'real' document has like 2000 rows, and the solutions I found on Youtube was not good to scale.
Thanks in advance. I'm new to here so if I should clarify my question in any way, feel free to tell me.
If the raw is around 2,000 rows, you can use a nested index match with helper columns.
Add a rank in column C with the formula =COUNTIF(A2:$A$2,A2)
Then apply the same ranking in your output part as well (Ensure Activity Name is sorted so that the formula works), Output rank formula =IF(J2=J1,I1+1,1)
Formula that lists out the Product Code {=INDEX($B$2:$B$3190,MATCH(I2,IF($A$2:$A$3190=J2,$C$2:$C$3190),0))}
This is an array formula, you get the curly brackets by hitting control+shift+Enter instead of just Enter upon keying in the formula
If you are using excel 365, you can use UNIQUE formula.
=UNIQUE(A2:B18)

Return array based on titles

I'm, looking for a way to return an array of text based off of titles or headers if you will. My brain isn't working today and I keep struggling to find the best method. I originally was going to have a bunch of IF statements and ran into problems, and I can't seem to figure out if Aggregate is a viable method.
Essentially if "Title 1" is selected from a drop down I would like to return the names within Title 1, and so on. If "All" is selected I would like all to populate from each title. The speed bumps I have is that some names repeat and I only want to show each name once always in alphabetical order. Can someone please get me started on how to tackle this?
In Excel O365 with the FILTER function, you can do this with a helper column (which you can hide, or position elsewhere).
I created a Table and am using structured references, but you can change to ordinary addressing if you prefer.
TitleList is a named range that includes all or your titles (presumeably you will use this for your dropdown).
For the Helper Column, I have it adjacent to your Names column with the formula:
=IF(OR(A2=TitleList),ROW(),B1)
This creates a unique number for each title.
Then, for your formula, under the dropdown, you can use:
=FILTER(Table3[Names],(Table3[Names]<>G1)* (Table3[Index]=XLOOKUP(G1,Table3[Names],Table3[Index])))
where G1 contains the dropdown
With Column B visible:
Some with O365 do not have the FILTER function. If you do not have the FILTER function, you can use:
=INDEX(Table3[Names],AGGREGATE(15,6,1/(INDEX(Table3[Index],MATCH(G1,Table3[Names],0))=Table3[Index])*ROW(Table3)-ROW(Table3[#Headers]),ROW(INDEX($A:$A,2):INDEX($A:$A,COUNTIF(Table3[Index],INDEX(Table3[Index],MATCH(G1,Table3[Names],0)))))))
EDIT
To return a non-duplicate list of ALL of the names, add ALL to TitleList and use this formula instead.
This formula makes a special case for ALL and filters out the rows that contain a Title
=IF(G1="ALL",UNIQUE(FILTER(Table3[Names],COUNTIF(TitleList,Table3[Names])=0)),FILTER(Table3[Names],(Table3[Names]<>G1)*(Table3[Index]=XLOOKUP(G1,Table3[Names],Table3[Index]))))
.imgur.com/apkHh.png

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/

Searching multiple Postcodes in Excel

I have an excel sheet with 8000 records that i would like to search by postcode.
This is my client list and i would like to say search for all clients living in the "EH1","EH2","KY1","SW9" postcodes.
I would like the search to return all the values related to that postcode.
The excel document is laid out like this.
(ID,Name,Surname,Address,Postcode,Telephone Number)
Im a novice at excel spreadsheets so any help on this would be greatly appreciated.
ID Name Surname Address Postcode Telephone number
26584 John Smith 69 Bedford road Eh12 5db 0131225689
Thanks
Edited with quick and dirty method:
If you only need to use this table a few times, then there is a quick and dirty method:
Make a helper column that only includes the first 3 characters of the postcode. You do this via the left function, specifying the postcode column in the first argument, then "3" in the next, to return the first 3 characters. This effectively hides the values you haven't ticked.
You then use the filter section at the top of the column once you have made it a table as stated earlier. In the drop down menu untick "Select all", then tick the values you want to see, i.e. the postcodes you are interested in).
You can then copy the visible cells only via Copy visible cells only if you want to use just that list.
A longer, but more robust method would involve three tables. The first is your data set as it is, with the helper column as discused above included. The second would be a simple single column of all the first three letter codes you are interested in. The third would be an array function modified from this formula:
=index($a$1:$b$7,small(if($a$1:$a$7=$a$10,ROW($a$1:$a$7)),ROW(1:1)),2)
which returns multiple items based on preset criteria, ignoring those that are not specified. I would link to a site explaining this better but I am such a new user I can hardly do anything it seems :(
I suggest you simply use an autofilter on the respective column.
Here is a short tutorial for Excel 2010: AUTOFILTER TUTORIAL
I think an easy way to do this is first make Postcode column first; from Column E to Column A.
Insert a new column in Column A, then use the left function to get the first 3 characters of the postcode: =LEFT(B1,3)
With this, you can use VLOOKUP to search for the postcodes "EH1","EH2","KY1","SW9", and use multiple VLOOKUP formulas to return a column index of everything.
You'll end up with a list of everything for that specific postcode.

Resources