In my job I have to enter warranty information so that POs can be cut. Vendors are very particular with how this is entered and each one has their own format.
One of them requires data be entered:
SN:
MACHTYPE:
Further, the information for this is sent in a single composite number, something like:
10Y754235FUYJ9
Requiring the final input of data to be:
SN:10Y75423
MACHTYPE:UYJ9
The first 4 digits of the composite are the MACHTYPE and the final 8 are the Serial Number.
The impasse I've reached is I can't seem to get auto-fill to replicate the skipping of lines as I've formatted. It will jump a number of lines equal to however many I've selected.
Any ideas about getting it to replicate the first four Formatted Data? I've been throwing myself at this for a couple hours now.
Thanks in advance!
I think you're over complicating it by using two rows for the Formatted Data. I'd wrap the text (Home tab > Alignment section) for the cells in column F and use the following formula to insert a new line:
=CONCATENATE("SN:",B1,CHAR(10),"MATCHTYPE:",C1)
Then just leave the formatting like you had it by row...
Okay, let's focus on the title. When A1 is 10Y754235FUYJ9,
="SN:"&LEFT(A1,8)&CHAR(10)&"MATCHTYPE:"&RIGHT(A1,4)
will give you the output:
SN:10Y75423
MATCHTYPE:UYJ9
And don't forget to set the wrap text checked at Format Cells menu.
Related
I have data in notepad with more than 1000+ entries, which need to convert in to Excel with particular break based on length. can someone help
011000015FRB-BOS FEDERAL RESERVE BANK OF BOSTON MABOSTON Y Y20040910
File format is as below
Position Field
1-9 Routing number
1 Office code
I tried delimiting option but dint worked out.
If your data always has the routing number in columns 1-9, then delimited import is the way to go. Choose Import From Text, then select Fixed Width and click Next. On Step 2, click at each character that would be a separator. Eg, click at character 9 to split it into two columns with the first column haviong the first nine characters and the second column having the rest. Step 3 will allow you to set the data format. I'd recommend setting the first column to text so Excel doesn't try to use scientific notation or something on your account numbers.
I have a column called 'cArticle' in excel, containing data in below format. I have a requirement to extract in another column the code that is in brackets. Ex- Z1A,F5C,etc
cArticle
Molecular Dispersion (Z1A)
Acrona Perse (F5C)
Leco Spers (HLP)
Cullar Dipters (LPP)
I have managed to get it partially working by using the below formula, but it still returns with values with the closing brackets. How can I modify it to get the desired results?
RIGHT(cArticle,4)
Thank you in advance!
If the string always ends with (XXX) and the content in the brackets is always 3 digit. You can also try:
=LEFT(RIGHT(cArticle,4),3)
If your code is always at the farthest right and is only 3 characters long, you can use formula as below
=SUBSTITUTE(RIGHT(cArticle,4),")","")
However if your code is not always at the farthest right and may be more or less than 3 characters than you can use formula below, which will work in all cases even if there is no code present
=IFERROR(MID(cArticle,FIND("(",cArticle)+1,FIND(")",cArticle)-FIND("(",cArticle)-1),"No Code")
The attached image (link: https://i.stack.imgur.com/w0pEw.png) shows a range of cells (B1:B7) from a table I imported from the web. I need a formula that allows me to extract the names from each cell. In this case, my objective is to generate the following list of names, where each name is in its own cell: Erik Karlsson, P.K. Subban, John Tavares, Matthew Tkachuk, Steven Stamkos, Dustin Brown, Shea Weber.
I have been reading about left, right, and mid functions, but I'm confused by the irregular spacing and special characters (i.e. the box with question mark beside some names).
Can anyone help me extract the names? Thanks
Assuming that your cells follow the same format, you can use a variety of text functions to get the name.
This function requires the following format:
Some initial text, followed by
2 new lines in Excel (represented by CHAR(10)
The name, which consists of a first name, a space, then a last name
A second space on the same line as the name, followed by some additional text.
With this format, you can use the following formula (assuming your data is in an Excel table, with the column of initial data named Text):
=MID([#Text],SEARCH(CHAR(10),[#Text],SEARCH(CHAR(10),[#Text])+1)+1,SEARCH(" ",MID([#Text],SEARCH(CHAR(10),[#Text],SEARCH(CHAR(10),[#Text])+1)+1,LEN([#Text])),SEARCH(" ",MID([#Text],SEARCH(CHAR(10),[#Text],SEARCH(CHAR(10),[#Text])+1)+1,LEN([#Text])))+1)-1)
To come up with this formula, we take the following steps:
First, we figure out where the name starts. We know this occurs after the 2 new lines, so we use:
=SEARCH(CHAR(10),[#Text],SEARCH(CHAR(10),[#Text])+1)+1
The inner (occurring second) SEARCH finds the first new line, and the outer (occurring first) finds the 2nd new line.
Now that we have that value, we can use it to determine the rest of the string (after the 2 new lines). Let's say that the previous formula was stored in a table column called Start of Name. The 2nd formula will then be:
=MID([#Text],[#[Start of Name]],LEN([#Text]))
Note that we're using the length of the entire text, which by definition is more than we need. However, that's not an issue, since Excel returns the smaller amount between the last argument to MID and the actual length of the text.
Once we have the text from the start of the name on, we need to calculate the position of the 2nd space (where the name ends). To do that, we need to calculate the position of the first space. This is similar to how we calculated the start of the name earlier (which starts after 2 new lines). The function we need is:
=SEARCH(" ",[#[Rest of String]],SEARCH(" ",[#[Rest of String]])+1)-1
So now, we know where the name starts (after 2 new lines), and where it ends (after the 2nd space). Assuming we have these numbers stored in columns named Start of Name and To Second Space respectively, we can use the following formula to get the name:
=MID([#Text],[#[Start of Name]],[#[To Second Space]])
This is equivalent to the first formula: The difference is that the first formula doesn't use any "helper columns".
Of course, if any cell doesn't match this format, then you'll be out of luck. Using Excel formulas to parse text can be finicky and inflexible. For example, if someone has a middle name, or someone has a initials with spaces (e.g. P.K. Subban was P. K. Subban), or there was a Jr. or something, your job would be a lot harder.
Another alternative is to use regular expressions to get the data you want. I would recommend this thorough answer as a primer. Although you still have the same issues with name formats.
Finally, there's the obligatory Falsehoods Programmers Believe About Names as a warning against assuming any kind of standardized name format.
I have a large spreadsheet with column data like:
ABC:1:I.0
ABC:1:I.1
ABC:1:I.2
ABC:1:I.3
ABC:2:I.0
ABC:2:I.1
ABC:2:I.2
ABC:2:I.3
ABC:3:I.0
ABC:3:I.2
ABC:3:I.3
ABC:4:I.0
ABC:4:I.1
ABC:4:I.2
ABC:4:I.3
ABC:5:I.0
ABC:5:I.1
ABC:5:I.2
ABC:5:I.3
ETC.
I need to replace the above with the following:
ABC:I.Data[1].0
ABC:I.Data[1].1
ABC:I.Data[1].2
ABC:I.Data[1].3
ABC:I.Data[2].0
ABC:I.Data[2].1
ABC:I.Data[2].2
ABC:I.Data[2].3
ABC:I.Data[3].0
ABC:I.Data[3].2
ABC:I.Data[3].3
ABC:I.Data[4].0
ABC:I.Data[4].1
ABC:I.Data[4].2
ABC:I.Data[4].3
ABC:I.Data[5].0
ABC:I.Data[5].1
ABC:I.Data[5].2
ABC:I.Data[5].3
ETC.
Here is a sample of the data, most of the data follows a similar format with the exception of the naming "ABC", which can vary in size, so it might be "ABCD" and also with the exception of the letter "I", it can be "O" as well. Also, some might be missing some values such as ABC:3:I.1 which is missing from the data. I am not too familiar with excel formulas or VBA code. Does anyone know how to do this? I have no preference on which method it has to be done in as I don't mind learning some VBA code if someone provides me with a VBA solution.
I was thinking of using some sort of loop along with some conditional statements.
Thanks!
Please try:
=LEFT(F11,FIND(":",F11))&MID(F11,FIND(":",F11,6)+1,1)&".Data["&MID(F11,FIND(":",F11,2)+1,1)&"]."&RIGHT(F11,1)
copied down to suit, assuming placed in Row11 and your data is in ColumnF starting in Row11.
Curiosities:
When this A was first posted it attempted to address only the tabulated example input and output. I temporarily deleted that version while addressing that what was in the table as ABC might at times be ABCD and that what was I might at times be O.
OP has posted an answer that I edited to make no visible change but which shows as the deletion of two characters. A copy of the OP’s formula exhibited a syntax error prior to my edit.
OP suggested an edit to my answer but this was rejected by the review process. As it happens, I think the edit suggestion was incorrect.
I have edited my answer again to include these ‘curiosities’ and to match the cell reference used by the OP in his answer.
=LEFT(A1,SEARCH(":",A1)) & MID(A1, SEARCH(".",A1)-1, 2) &
"Data[" & MID(A1,SEARCH(":",A1)+1,1) & "]" & RIGHT(A1,2)
With the help of pnuts I was able to come up with my own solution:
=LEFT(F11,LEN(F11)-5)&MID(F11,LEN(F11)-2,2)&"Data["&MID(F11,LEN(F11)-4,1)&"]"&RIGHT(F11,2)
My solution works based on the fact that the length of the last six values in the string ABC:1:I:0 will always be the same in size for all the data I have, hence you see LEN(F11)-some number in my code. The only part of the string that changes in size is the first part, in this case ABC which can also be ABCDEF, etc.
If you'd like to use formulas rather than VBA, an easy option is to split the data into 4 columns, using the Text To Columns option - first split using the colon as a delimiter, then using a full-stop / period as a delimiter.
Once you have 4 columns of data (one for each block), you can use the Concatenate function to join them and add in the extra characters: =CONCATENATE(A1,":",C1,".","Data[",B1,"].",D1)
This should still work if you have extra / alternative characters (eg ABCD instead of ABC), as long as you have the same delimiters, but obviously you'd need to test to make sure.
I've got a long list of codes and text in the same cell. I need to return all the text from the right BUT the first five characters
ex. V2341 something here
I need to return the something here
=RIGHT(LEN(A1)-5)
That's what I've tried, but no luck with it. I know it's gotta be close to correct, what am I missing?
Thanks.
You're looking for MID.
If column A contains
A C D
==================== ====================== ==============
1 ABCDE12345 D1=MID(A1, 6, LEN(A1)) 12345
2 ABCDE1234567890ABCD D2=MID(A2, 6, LEN(A2)) 1234567890ABCD
REPLACE function can also be used to replace a designated number of characters with nothing, i.e.
=REPLACE(A1,1,5,"")
You can also select the whole column, use ctrl+f, then find and replace the 'v' with nothing. This will work easily if you have the same first amounts you are trying to get rid of.
If you are trying to get rid of the same number of characters, but they are different characters, you can go to Data -> Text to Columns (in Data Tools Sections). Then select the radio button fixed width. Click Next. Move the line in the graphic to the position you want it in, click Finish.