In a NetSuite search I need to perform two searches.
One for results where field A is equal to field B and a second one where field A does not equal field B.
When I am entering criteria for a search when I select a field and choose equal to I am only given the option of entering a set number into the VALUE field.
I even looked at highlighting the values which are not equal, though that is the same entry form as the criteria one.
How can I achieve the above results?
You need to use a formula field using the advanced search dialog. I generally do that like this:
case when {firstfield} = {secondfield} then 1 else 0 end
and make the formulanumeric test equal to 1.
Related
I'm trying to create a dropdown menu in excel which eliminates values once they have been selected.
Let's assume that the dropdown offers the values 1...10. If I select 1 in the first dropdown, then the other dropdowns needs to offer only 2...10. Likewise, if I picked to, the the other should offer only 1,3,4,5,6,7,8,9,10.
Basically we want managers to rank their employees based on the performance value.
But if they rate everyone a 4, we need a ranking - but we then dont want them ranking everyone as 1.
I tried with IF statements, but we can have rankings of up to 100 people, so it was becoming a nightmare.
Not sure if I am clear?
Any help would be appreciated.
You can use data validation custom formula to avoid duplicates. It would not be a dropdown but it would work exactly as you wish:
In my example, I've selected range B2:B5 and then I applied a data validation custom formula like this:
=COUNTIFS($B$2:$B$5;B2)=1
You can even customize the error message:
With that formula, any entered value will be accepted exactly once. If it's used again, it will raise an error.
Notice I can't type a second time the value 1 because it's been already used.
You can do this by creating a helper table which lists all the valid ranks and whether or not they have been used yet. This can be on the same sheet or another, hidden sheet if you prefer:
The formula in the "Used?" column is a simply counts the number of times that rank appears in the "Rank" column and checks if it is greater than 0 - returning TRUE or FALSE:
=COUNTIFS($B$2:$B$11,$H2)>0
The "Remaining Ranks" column then uses this in a MINIFS formula to remove the used ranks:
= MINIFS(
$H$2:$H$11,
$H$2:$H$11,">"&MAX($K$1:$K1),
$I$2:$I$11,FALSE
)
This is saying to select the lowest number from the "All Ranks" column, where the rank hasn't already been listed in the "Remaining Ranks" column AND the "Used?" column is FALSE.
This will result in zeros at then bottom of the "Remaining Ranks", so we can wrap it in an if statement to replace the zeros with an empty string "":
=IF(
MINIFS($H$2:$H$11,$H$2:$H$11,">"&MAX($K$1:$K1), $I$2:$I$11,FALSE)=0,
"",
MINIFS($H$2:$H$11,$H$2:$H$11,">"&MAX($K$1:$K1),$I$2:$I$11,FALSE)
)
You can now use the "Remaining Ranks" column as your source for the data validation list, and it will update as the ranks are entered.
This will result in some blank options at the bottom of the list.
If these are an issue for you, they can be removed by using an INDEX formula in a named range. Let me know if you would like me to explain how that can be done.
I've made a list of bars for my friends/coworkers and I want to add a tool that allows them to search for bars that match their preferred criteria.
The google sheet can be found here.
I want the user to be able to search based on the criteria they input on the left under "keywords". So this many be anywhere from 1, keyword to all 7 filled out. But I want it to search based on any combination.
I initially started with an INDEX/MATCH formula which only returned a single row.
I landed on the FILTER function after trying different options.
However, this does not ignore blank search terms. Cell D4 on the Search page has the current formula. This will filter by Area, and then Area and Category if both are filled out, but I have yet to figure out how to expand this to the remaining filters.
My current function is the following:
=IFERROR(IF(AND(LEN(B6),LEN(B7)),FILTER(AllInfo,Area=B6,Category=B7),FILTER(AllInfo,Area=B6)),"-")
The filter function does exactly what I want for one search criteria, but my attempts to include any combination of search terms have failed.
I have a number of named data ranges which reference their respective columns on the 'Toronto - BARS' sheet.
Feel free to share this list with any friends living in Toronto!
Edit: removed irrelevant information
The closest I got is the formula below, which requires you to replace the boolean values into "yes" and "no" (or any other string values):
=ArrayFormula(query({AllInfo},"select * "&if(counta(B6:B12)>0,"where ",)&join(" and ","Col"&(match(filter(A6:A12,B6:B12<>""), transpose('Toronto - BARS'!A1:I1),0))&"='"&filter(B6:B12, B6:B12<>"")&"'"),0))
2 improvements that could be made, but I didn't figure it out:
using the column names in the query, instead of column number
parsing the boolean values correctly and add or remove the single quotes accordingly, so it can support the current boolean values / checkboxes
==> I hope someone can pick that up and finish what I couldn't get done.
Backstory
I have been tasked with creating a system that fills in excel files for the user based on them entering minimal information. This includes categories, of which we have too many. I have a function that searches a cell for one list of criteria and returns the adjacent cells result. But with so many criteria there are often times where a wrong result is returned.
What I want to do is use a second criteria to make the search more specific.
My current setup
The formula that I can currently using is:
=INDEX(Categories!D$3:D$53,MATCH(TRUE,ISNUMBER(SEARCH(Categories!C$3:C$53,I2)),0))
So whatever the user enters into I2 is cross-referenced with Categories!C$3:C$53 and if there is a match then Categories!D$3:D$53 is returned.
Image
So you can see how its set up in the picture, purple is the second search criteria I'd like to add.
I did try to add a match function at the beginning so IF another cell = Cordless Power Tools then I could narrow down the search. But that would mean a separate formula for every category and sub-category of which there are hundreds.
Thank you for any help that you can be.
Edit - I have realised that what I want is actually much more complicated than I had originally thought.
What I want is to be able to search a cell for a match in column B and then if there is a match then only search that section in C to return adjacent value in D.
For example. I have a tool - an 18v 115mm Angle Grinder. So my search string is "18v 115mm Angle Grinder", The formula would then search this string for a match in column B which it does (B61) so then the formula would search for a match in "18v 115mm Angle Grinder" in only column C61 and C62, finding a match and returning "Grinders" from D61.
I realise this looks pointlessly complicated but there are hundreds of categories I'm trying to implement this in and there are simpler titles in all of them so I'm trying to narrow the search down so I don't have to use multiple formulas.
Thank again for any help anyone can be.
If you want to add another condition in the search, say, that column A matches what's entered by the user in J2, add the condition to your search using the * operator that applies a logical And on different conditions. But the only thing is that its result is a number 1/0 instead of True/False.
=INDEX(Categories!D$3:D$53,MATCH(1,
ISNUMBER(SEARCH(Categories!C$3:C$53,I2))
* (Categories!A$3:A$53 = J2)
,0))
p.s. dont forget to parenthesize the factors when using * as logical operator.
I have a column of strings (descriptions of errors manually entered by personnel) (A2:A1000) that I'd like to search for specific words (to create categories based on the description), and based on the words found, input a specific case value (a category label) into a second column (B2:B1000). Currently this is being handled by nested if statements of the form
B2=if(isnumber(search("Flag Word 1",A2)),"Case Word 1", if(isnumber(search("Flag Word 2",A2)),"Case Word 2", ...))
Obviously for a large number of flag/case words, this gets messy pretty quickly. I'd like to be able to create a lookup table, have excel search column A for words in the lookup table, and return the corresponding value, but I'm not sure if this is possible - it doesn't seem that way without resorting to VBA. Are there any alternative methods to achieving the same result?
Thanks,
~P
You could try an array formula like this one (has to be entered with Ctrl-Shift-Enter):-
=INDEX($D$2:$D$4,MIN(IF(ISNUMBER(SEARCH($D$2:$D$4,A2)),(ROW($D$2:$D$4)-ROW($D$1)))))
It assumes that there is a list of keywords in D2:D4, and will give you the first one in the list which is contained in the string in A2. You could change MIN to MAX to get the last match.
Short version:
Basically I want to do this, but in excel. Instead of querying a table USING wildcards, I want to query a table that CONTAINS wildcards.
Long version:
I'm creating a spreadsheet to summarize my bank account transactions at the end of each month. I want to organise the transactions in my bank statement into categories like "groceries", "entertainment", "fuel" etc and then sum up the total amount spent on each category.
I have a sheet that acts as a database, with a list of known account names for each category (e.g. under "clothing" I have the names of the accounts of all the clothing stores I go to). I then have another sheet with the first two columns containing transactions (account name, and amount), and then a column for each category. I copy each amount in column 2 into the correct category column using the following formula:
=IF(ISNA(MATCH($B2,database!B:B,0)),"",$C2)
Where column B is the "account name" column from my bank statement, and column C contains the amounts.
This works fine as long as the data in the database worksheet is an exact match. But a lot of the account names are similar e.g. "7elevenl12345", "7eleven836549" etc. How can I add strings with wildcards like "7eleven*" to my database?
Thanks in advance.
You can use SEARCH for all the column B values in B2, although better to restrict the range so I'll use rows 2 to 100
=IF(ISNUMBER(LOOKUP(2^15,SEARCH(Database!B$2:B$100,$B2))),$C2,"")
SEARCH automatically searches for a value within other text so no wildcards required [you should remove wildcards from the database you only need "7ELEVEN" etc.]. If one (or more) of the searches is a match then it will return a number and so will LOOKUP so you can test whether it does or not.
SEARCH function is not case-sensitive, change to FIND if you want the match to be case-sensitive
Explanation:
When you use
=SEARCH(Database!B$2:B$100,$B2)
That returns an "array" the same size as Database!B$2:B$100. For each value in Database!B$2:B$100 you either get a number (if that specific value is found within B2 it's the position of the start of that value) or you get #VALUE! error.
Then when you lookup a "bignum" like 2^15 in that array, i.e.
=LOOKUP(2^15,SEARCH(Database!B$2:B$100,$B2))
That returns the last number found in the array....or #N/A if there are no matches, so using ISNUMBER identifies whether there is at least one match or not.
If you want to see the whole array returned by
=SEARCH(Database!B$2:B$100,$B2)
then put that in a cell and then select that cell, press F2 to select the formula and F9 to see the whole array.
If you have blanks in Database!B$2:B$100 then that's a problem because a blank is always "found" in any value (at position 1) so you can edit the formula to prevent that, i.e.
=IF(ISNUMBER(LOOKUP(2^15,SEARCH(Database!B$2:B$100,$B2)*(Database!B$2:B$100<>""))),$C2,"")
both versions of the formula can be shortened by using COUNT in place of LOOKUP and ISNUMBER, i.e. for that latter version you can use
=IF(COUNT(SEARCH(Database!B$2:B$100,$B2)*(Database!B$2:B$100<>"")),$C2,"")
but that version needs "array entry" - i.e. you need to confirm the formula with the key combination CTRL+SHIFT+ENTER such that the formula is enclosed in curly braces like { and }
Note: 2^15 is used here because it is guaranteed to be a larger number than any number that SEARCH function can return. 2^15 = 32768 but the maximum number of characters in a cell is 1 fewer than that - 32767
You would to change your formula to: =IF(ISNA(MATCH($B2&"*",database!B:B,0)),"",$C2)
I think this is what you're looking for.