Is it possible to search for a specific text in cells and move it?
For example: "ABCD [45] - City"
Result: "[45] ABCD - City"
Of course you can.
It is possible by code, formulae or search/replace (using regex).
In your example you search for something in square brackets and put this finding in front.
A regular expression search here will be
search for: (.*)(\[.*\] )(.*)
replace by: $2$1$3
Don't forget to tick the option "regular expression"
[Everything to search and replace with this is explained in online help: F1]
If you want code or formulae to have the task accomplished: ask more specific!
Related
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.
I Have a cell A2 in Excel with:
BenQ ZOWIE XL2411P 24" LED 144Hz e-Sports
I want extract phrases and transform them.
If text contain "LED" so write "Display: LED | ". If text contain "144Hz" so write "Refresh Rate: 144Hz | ". How can I do it with one function in one cell?
Thanks
You can use nested SUBSTITUTE functions for this
eg, if your text is in A1, then use
=SUBSTITUTE(SUBSTITUTE(A1,"LED","Display: LED"),"144Hz","Refresh Rate: 144Hz")
Note that this will find the search terms imbeded within other terms. Eg if you already had ...Display: LED... in your string, this will return ...Display: Display: LED...
I'm not sure I understand what you mean by "I want extract phrases and transform them." But I would think you could do something similar to displaying the result by using the ampersand. From the examples you might be able to use
IF(ISNUMBER(SEARCH("LED",A2)),"Display: LED |")&" "&IF(ISNUMBER(SEARCH("144Hz",A2)),"Refresh Rate: 144Hz |")
Though I can't verify that will work right now.
https://www.techwalla.com/articles/how-to-create-multiple-formulas-for-the-same-space-in-excel
https://www.excel-easy.com/examples/contains-specific-text.html
I ran into something unexpected after creating a spreadsheet.
I currently have a formula that lookups the text "A Term" within a cell.
=IF(FIND("A Term",P2),"A Term",0)
I need this formula to also look for the text "Full Term".
In other words, I need it to say "A Term" if either the text "A Term" or "Full Term" is located within the cell, P2.
Any help is appreciated.
The answer is (literally) in your question: an OR statement:
=IF(OR(ISNUMBER(FIND("A Term",P2)),ISNUMBER(FIND("Full Term",P2))),"A Term",0)
Note that FIND is case sensitive, if you want a case insensitive search, use SEARCH
=IF(OR(ISNUMBER(SEARCH("A Term",P2)),ISNUMBER(SEARCH("Full Term",P2))),"A Term",0)
I have words coded within daily notes
These are like diary entries with coding at the end...
I took some advil today,tired=.5,headache=.75, etc
rode a bike for 3 hours,tired=.75,headache=.75, etc
Can I write a formula that can search for the phrase tired=.5 or tired=.75 and put the .5 or .75 in the cell. There are only 4 possibilities for levels .25,.5,.75, and 1. If it doesn't find a statement for tired it should give back 0.
This works for absolute phrase matches.
=IF(A1="tired=.75",.75),IF(A1="tired=.5",.5),IF(A1="tired=.25",.25)
but I'm not sure how to use search to do the same thing.
Here is my failed attempt at using search.
=IF(ISNUMBER(SEARCH("tired=.75",B1484)),0.75,0),IF(ISNUMBER(SEARCH("tired=.25",B1484)),0.25,0)
I think this will do it:
=VALUE(MID(A1,SEARCH("tired=",A1)+6,FIND(",",(MID(A1,SEARCH("tired=",A1),12)))-6-1))
No reason to use IF statements, just FIND and convert the text directly. I mix FIND and SEARCH here, you can use one or both as you prefer (FIND is case sensitive, SEARCH is not).
In a Notepad++ or an editor with similar features, is there an easy to search for a word which contains a number? For instance, suppose numbers were denoted by "~", then if I searched for "abc~" in the following text:
abc4
abc not a number
I would simply get the first word.
Use the "regular expression" search mode. If you just want to find groups of numbers, use \d+. If you want it to select the whole word containing one or more digits, use \w*\d+\w*.
Type this regular expression in the Find dialog box (select the regex option):
\w*\d\w*