How do I remove brackets with specific texts? - excel

How do I replace specific text in brackets in excel? Would I use the replace function or the substitute function? I know this maybe a simple solution but I am pretty confused.
Please see example below. I am trying to remove brackets that contain (Number m).

Related

Using the replace function in Netsuite for components in assemblies

Very new to Netsuite. I'm trying to use a saved item search to find all instances of {componentitem} entry is 800484 and replace them with component 516551302688
I'm using the REPLACE function in the saved item search but it doesn't like my formula REPLACE(800484, [, 516551302688]){componentitem}
I'm sure I am doing something wrong in the formula but unsure what it is.
The function signature for REPLACE is:
REPLACE(char, search_string, replacement_string)
char is the text to search in.
search_string is the text to search for.
replacement_string is the text to replace the search_string with, where found.
What you have appears to be more like
REPLACE(search_string, replacement_string)char
The text you want to search in is outside of the function altogether (outside the parentheses that enclose what the function will act on). You also have additional brackets and a comma in your formula.
Based you the information in your question, your formula should be
REPLACE({componentitem}, '800484', '516551302688')
I have wrapped the search and replacement strings in quotes as REPLACE deals with strings. If you leave the quotes off, the database will infer the string values of the numbers given and it will still work, but it's best practice to be explicit.
Note that this will only replace the values within the results of the saved search, and will have no effect on the underlying records. Hopefully you already know this, but I just mention it as the wording of your question makes it appear as if you're expecting it to substitute the actual components.
HTH.

Excel: Find words of certain length in string?

I have this file where I want to make a conditional check for any cell that contains the letter combination "_SOL", or where the string is followed by any numeric character like "_SOL1524", and stop looking after that. So I don't want matches for "_SOLUTION" or "_SOLothercharactersthannumeric".
So when I use the following formula, I also get results for words like "_SOLUTION":
=IF(ISNUMBER(FIND("_SOL",A1))=TRUE,"Yay","")
How can I avoid this, and only get matches if the match is "_SOL" or "_SOLnumericvalue" (one numeric character)
Clarification: The whole strings may be "Blabla_SOL_BLABLA", "Blabla_SOLUTION_BLABLA" or "Blabla_SOL1524_BLABLA"
Maybe this, which will check if the character after "_SOL" is numeric.
=IF(ISNUMBER(VALUE(MID(A1,FIND("_SOL",A1)+4,1))),"Yay","")
Or, as per OP's request and suggestion, to include the possibility of an underscore after "SOL"
=IF(OR(ISNUMBER(VALUE(MID(A1,FIND("_SOL",A1)+4,1))),ISNUMBER(FIND("_SOL_",A1))),"Yay","")
Here is an alternative way to check if your string contains SOL followed by either nothing or any numeric value up to any characters after SOL:
=IF(COUNT(FILTERXML("<t><s>"&SUBSTITUTE(A1,"_","1</s><s>")&"</s></t>","//s[substring-after(.,'SOL')*0=0]")>0),"Yey","Nay")
Just to use in an unfortunate event where you would encounter SOL1TEXT for example. Or, maybe saver (in case you have text like AEROSOL):
=IF(COUNT(FILTERXML("<t><s>"&SUBSTITUTE(A1,"_","</s><s>")&"</s></t>","//s[translate(.,'1234567890','')='SOL']")>0),"Yey","Nay")
And to prevent that you have text like 123SOL123 you could even do:
=IF(COUNT(FILTERXML("<t><s>"&SUBSTITUTE(A1,"_","1</s><s>")&"</s></t>","//s[starts-with(., 'SOL') and substring(., 4)*0=0]")>0),"Yey","Nay")

PROPER capitalize only certain parts of text if fit criteria

How can I only PROPER capitalize the first and last portion of what is inside a Excel cell; and leave out what is surrounded by dashes.
Currently I have the following structure in my Excel spreadsheet;
JANSON-CT-RELSON
When applying the PROPER formula it turns the text into Janson-Ct-Relson.
How can I make the formula skill what is inside the dashes? I need it to be:
Janson-CT-Relson
While this is by no stretch going to win any beauty pageants, it should work:
=PROPER(LEFT(A1,SEARCH("-",A1)-1))&MID(A1,FIND("-",A1),FIND("-",A1,FIND("-",A1)+1)-FIND("-",A1)+1)&PROPER(MID(A1,FIND("~~~~~",SUBSTITUTE(A1,"-","~~~~~",LEN(A1)-LEN(SUBSTITUTE(A1,"-",""))))+1,LEN(A1)))
Per your comment on the OP, you can tweak it down a little, if we know there's only two initials in the middle:
=PROPER(LEFT(A1,SEARCH("-",A1)-1))&"-"&MID(A1,SEARCH("-",A1)+1,2)&"-"&PROPER(TRIM(RIGHT(SUBSTITUTE(A1,"-",REPT(" ",LEN(A1))),LEN(A1))))
Note: This only works for X-Y-Z, not W-X-Y-...-Z types.

Finding question marks in cell string

I would like to find out if a string within a cell in Excel 2010 contains any of the following, and then return a '1'.
?dementia
? dementia
dementia?
dementia ?
I've tried some formulas but they don't seem able to get past the use of the wildcard and the string when combined.
Would anyone have any pointers or advice?
Here is a combination of the suggested answers, and my own work around:
This is the formula you need:
=IF(IFERROR(FIND(A2,$C$3),0)>0,1,0)
where A2 is the string that you are trying to check.
Assuming you don't want to include word ? word and return 1, you can use something like this:
=IF(OR(LEFT(A1,1)="?",RIGHT(A1,1)="?"),1,"")
You will want to use the FIND function (Documentation).
Make sure your search term in in quotation marks.
If you are still having trouble with wildcards, you can try the CHAR function (Documentation). It will return the character as a string. In your case, to get a ?, you would use CHAR(63). I use this chart to keep track of CHAR codes (just use the number and ignore the "Alt")
REVISED:
If I understand the question correctly, you are trying to search long string in a short string list.
The formula you can use is:
=ISTEXT(LOOKUP(99^99,SEARCH(SUBSTITUTE($A$2:$A$5,"?","|"),SUBSTITUTE(C2,"?","|")),$A$2:$A$5))*1
The problem with my prior formula is due to that ? mark because it is being treated as a wild card. Here I have replace it with | (you can change this to a character that you will never use but avoid ? and *). This should work for you now.

How to replace wildcharacter in CSV

I have below string in csv files
Part Number WP1166496 (AP6005317) replaces 1166496, 1156976.
Expected Output -
Part Number WP1166496 replaces 1166496, 1156976.
I want to replace (AP6005317) this with blanks.
As there are many rows with different values.
So how can I replace this string with brackets to blanks value.
I don't know how to achieve this exactly in Microsoft Excel.
If you look for find and replace feature, most probably you can see option to replace with regular expressions.
Use regular expression option and replace \(.*\) with (simple space). This will solve your problem.
Note : This is tested and verified in LibreOffice Calc.

Resources