So i have this column of numbers and i wish to extract only the numbers before the "HE" text for example, this is what i need, and i don't really know how to achieve this.
Maybe there is a way to use a formula or command to do this, i've been trying to use power tools add-on but to no avail i did not get it.
Maybe for clarification in each cell there are 2 lines, using alt+enter.
REGEXEXTRACT() is suitable in this case.
=REGEXEXTRACT(A1,"(.+) HE")
Few good tips here about REGEXEXTRACT().
For array approach use below formula-
=ArrayFormula(IF(A1:A="","",REGEXEXTRACT(A1:A,"(.+) HE")))
Related
I have been trying to extract the required data from a single cell and I have tried using some common formulas but its not working for all the cells exactly.
I would appreciate your help in this regards.
Google Sheet
Formula 1
=LEFT(A2,FIND(C2,A2)-1)
Formula 2
=SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(LEFT(RIGHT(A2,len(A2)-FIND(") ",A2)),6),")",""),"(","")),"|","")
I duplicated your tab and entered the following formula in cell E2:
=ArrayFormula(ifna(regexextract(A2:A,"\[\s\]\s(.+)?\s\((.+)\)")))
Explanation
\[\s\]\s - find [ ]
(.+)?\s\( - extract everything after it until the next occurence of (
(.+)\) - extract everything after the above ( and before the next occurence of )
EDIT: The first time I've tried #ztiaa answer it didn't work... don't know why. I kept investigating REGEX and gave it another try, and it did... You'd probably prefer that. I leave my answer just as a memory, and if it's useful for someone else in another scenario
Honestly, I don't handle regex as #ztiaa, but what I've found difficult about your example is that there are sometimes more than one opening parenthesis... that's why I looked for a way of finding the last appearance of "(". You can learn more about this workaround here
I changed "#" with "CUT HERE" in my example, just in case "#" may appear in your example. With that in mind, you can set these two formulas:
=ArrayFormula(IF(A3:A="","",MID(A3:A,5,FIND("CUT HERE",SUBSTITUTE(A3:A,"(","CUT
HERE",LEN(A3:A)-LEN(SUBSTITUTE(A3:A,"(",""))))-5)))
=arrayformula(if(A3:A="","",mid(A3:A,FIND("CUT HERE",SUBSTITUTE(A3:A,"(","CUT
HERE",LEN(A3:A)-LEN(SUBSTITUTE(A3:A,"(",""))))+1,FIND(")",A3:A,FIND("CUT
HERE",SUBSTITUTE(A3:A,"(","CUT
HERE",LEN(A3:A)-LEN(SUBSTITUTE(A3:A,"(",""))))+1)-FIND("CUT
HERE",SUBSTITUTE(A3:A,"(","CUT
HERE",LEN(A3:A)-LEN(SUBSTITUTE(A3:A,"(",""))))-1)))
The second one is really long because it has to find the amount of characters in between brackets. But it appears to work. Probably there's a more ellegant way with Regex, I repeat :)
Look in J and K of your example:
I have a column with lots of rows containing text. I want to highlight cells with over an x-amount of characters, but how? The code I'm using in combination with 'Conditional Formatting' is not working all the time. Sometimes it highlights text over the x amount and sometimes it doesn't, so there is something I'm doing wrong here. The x-amount in the example below is: 300.
you may also need to lock it like:
=LEN(E$1:E$170)>300
Silly me... I found the answer myself. I need to put in the same range in the formula as well. Formula with the range E1:E170 needs to be: =LEN(E1:E170)>300
Newbie on coding and don't know how to make it work: Have the equation and need to change 3 variables depending on the situation.
Tried to Google but I guess I don't know what I'm exactly looking for as English isn't my first language
https://docs.google.com/spreadsheets/d/1HUw724okFB94GpeYmF3sacQBgQRnpnTSvgMMSk6RX4Y/edit?usp=sharing
=B4+(((B3/100)*280.059565*(B2^-0.412565956)-B3))
EZ stuff but after an hour.. =filter(May15!A:S , May15!E:E="Authorization") is yielding a rich populated sheet. However I can't get OR working! Despite it working elsewhere in the sheet. I'd like other possibilities via the same filter. I tried several including the OR this way
=filter(May15!A:S , OR(May15!E:E="Authorization" , May15!E:E="bigwhale", May15!E:E="hi"))
.. to no avail. Any help appreciated. Also, I read somewhere the OR could be accessed using a "+" and that sounded like a neat method.. Thanks!
One possible way is to use RegEx:
=filter(H:H , REGEXMATCH(E:E,JOIN("|",A1:A3)))
put in A1:A3:
Authorization
bigwhale
hi
This trick is useful when you need to add conditions, just paste one more value in cell A4 and use range A1:A4
Another way is to use plus sign:
=FILTER(H:H,(E:E="Authorization")+(E:E="bigwhale")+(E:E="hi"))
I am trying to copy some information from another sheet and sum them with different multipliers. This code roughly works:
=VLOOKUP(D8,Market!A:K,11,FALSE)+VLOOKUP(E8,Market!A:K,11,FALSE)*2+VLOOKUP(F8,Market!A:K,11,FALSE)*3+VLOOKUP(G8,Market!A:K,11,FALSE)
I am sure there must be a shorter way to do this - what is it?
It's not shorter but an alternative approach might be:
=MMULT({1,2,3,1},{VLOOKUP(D8,Market!A:K,11,0);VLOOKUP(E8,Market!A:K,11,0);VLOOKUP(F8,Market!A:K,11,0);VLOOKUP(G8,Market!A:K,11,0)})