I have 1000's of record in a database and I have one field as name and other as code
now i want to replace all code with every 1st letter after space from name for example
in name field
Manoj Sir Madan then replace code will be "MSM"
Suraj Bhai Bhanu then replace code will be "SBB"
Aayush Deepak Bhanu then replace code will be "ADB"
1st letter from start then every 1st letter after space
I do not have code nor did I find any
Can any one help me with this
Related
Hello and good day everyone!
I need your help and advise, i've one set of table and data as per below, and i'd like to use a formula to extract specific value from a single cell by using some value as indicator to indicate which text's line to extract.
Given the sample table as below,
Column A
Column B
Column C
This is example of the long texts value with multiple linethis text is very long also included value as below,Company: Apple IncContractor name: John Wick the value above, is per line.. and this text continue.. continue text..example text again..
This is where i'd like to display the Company name extracted from Column A
This is where i'd like to display Contractor name extracted from Column A
Example of what i want to achieve,
Column A
Column B
Column C
This is example of the long texts value with multiple line this text is very long also included value as below,Company: Apple IncContractor name: John Wick the value above, is per line.. and this text continue.. continue text..example text again..
Apple Inc
John Wick
I've tried with
LEFT()
MID()
=LEFT(A2,SEARCH("Company",A2)-1)
=REGEXREPLACE(A2,"(.*)Company(.*)","$2")
with no success.
May I request your advise and help on this please!
Thanks in advance.
In your situation, how about the following sample formula?
Sample formula:
Retrieve "Company name".
=TRIM(REGEXEXTRACT(A1,"Company:(.+)"))
Retrieve Contractor name
=TRIM(REGEXEXTRACT(A1,"Contractor name:(.+)"))
Testing:
When these formulas are used, the following result is obtained.
Note:
For example, the base data is put to the cells "A1:A3", you can also use the following formulas.
=ARRAYFORMULA(TRIM(REGEXEXTRACT(A1:A3,"Company:(.+)")))
=ARRAYFORMULA(TRIM(REGEXEXTRACT(A1:A3,"Contractor name:(.+)")))
Reference:
REGEXEXTRACT
So I am going around this the long way but what I am trying to do is extract the text in the center of a cell with text on both sides of it.
Example Text is:
Alliance: CRAZY CATS (Neutral)
Alliance: Dark Arts (Yours)
Alliance: Portal (Hostile)
I want to extract everything between : and (
In these cases I only need the name of the alliance the person is in. I tried to do a regedit but didn't completely understand it. I tried a few different formulas but was only able to remove either the first part or the last part and I could push them to two different cells but couldn't get them to work together in the same cell.
You can use REGEX functions, but I find that not everyone understands them. So here, I'll supply a non-REGEX solution.
Supposing your sample data were in A2:A4 (with some header in A1), place the following in B2 (or row 2 of any other column):
=ArrayFormula(IF(A2:A="","",TRIM(MID(A2:A,FIND(":",A2:A)+1,FIND("(",A2:A)-FIND(":",A2:A)-1))))
=REGEXEXTRACT(A2, ":\s*([^(]+)\s*\(")
: literal ":"
\s* zero or more space characters
() capture group
[^(]+ one or more of any character except (
\( literal (
See
What does this regex mean?
Tag info page
I have a Google Spreadsheet.
Google Spreadsheet
When users enter a name into any cell of column A of the sheet named "Unit Standards" I want them to enter that name in a particular format. That is, with the surname first in uppercase then a comma, then the first name in title case then if they are known by a different name that name to be title case in brackets e.g.
BUSH, George
TRUMP, Donald
CLINTON, William (Bill)
CARTER, James (Jimmy)
SMITH-JONES, John
ZETA-JONES, Catherine (Kate)
Is there a way to force them to do that before they leave the cell or the sheet?
You could use a script. Still.
You can have the same results with a simple formula using Data Validation on column A.
This is the formula to put in cell A2 for the range A2:A555:
=REGEXMATCH(A2,"^[A-Z]+\b[',']\s[A-Z]{1}[a-z]+\b(\s([A-Z][a-z]+\b))?$")
Reading the regular expression:
^[A-Z]+\b[',']\s[A-Z]{1}[a-z]+\b(\s([A-Z][a-z]+\b))?$
^[A-Z]+\b: In the beginning have only 1 or more capital letters until the end of the word
[',']\s: Have a , followed by an empty space
[A-Z]{1}[a-z]+\b: Have only 1 capital letter and 1 or more small letters till the end of the word
(\s\([A-Z][a-z]+\b\))?$: All of the above could be followed ? by this string.
\s\(: An empty space and an opening parenthesis (
[A-Z][a-z]+\b: A word starting with just 1 capital followed by 1 or more small letters
\): A closing parenthesis
$: End of string
I want to get the first name and middle name from cell. I am able to get the first name with the excel formula:
=LEFT(D2,FIND(",",D2)-1)
The name i.e Shukla,Vinay Devanand is reflecting in cell and I am able to get Shukla with above formula and now want only Vinay (All the characters after first comma and before first space)
Please help with the formula.
Vinay can be extracted by applying what is essentially the same process (replacing space for , however) on what is left once one more character (the ,) is added to the length of what is already known (Shukla) and used as the start point:
=LEFT(MID(D2,LEN(LEFT(D2,FIND(",",D2)))+1,LEN(D2)),FIND(" ",MID(D2,LEN(LEFT(D2,FIND(",",D2)))+1,LEN(D2))))
How do I replace a line in TextPad ' with nothing (ie: delete lines with just that one character)?
I have an Excel Spreadsheet containing three columns:
Column A - single quote
Column B - some number
Column C - single quote plus a comma
There are over 90,000 rows on this spreadsheet with data in column B. There are over one million rows with just a single quote in column A because I did a "Ctrl+D" on that column to copy the value in that column (a single quote) down to all rows.
When I copy and paste these three columns into TextPad, I end up with over one million lines. I replaced the tabs with nothing using the F8/Replace dialog.
(Replace: tab with: empty string)
The majority of what is left are lines that contain only a single quote. I want to delete these 900,000 extra lines.
How do I specify a Replace (delete) of single quote + line feed. I do not want to delete any of the single quotes from the lines that include a number that came from column B.
I just figured it out. The backslash n is the line feed.
If I check Regular Expression and enter this Find what:
'\n
(Keeping empty string for Replace with) and Replace All, I have deleted those extra lines.
I also experienced the same...it did not work for me until I did this:
uncheck the regular expression first before entering \n in the find box and replacing with whatever you chose to (in my case, it was ',').
Your result might be an entire list becoming transposed (that's what happened to my data).