I have one cell like this:
930 "<h2>Crawford, 1963-</h2> [wpse_playlist type=""audio"" tracklist=""true"" tracknumbers=""true"" images=""true"" artist=""true""] [wpse_trac title=""Indian Summer"" src=""http://urlnamehere/bitstream/handle/2374.UC/731507 /Elliston_Marisa_Crawford_01-10-14_Track_01.mp3?sequence=7"" type=""audio/mpeg"" caption="""" description="""" meta_artist=""Crawford, Marisa & Pendarvis, Jack, 1963-"" meta_length_formatted="""" thumb_src="""" image_width=""300""][wpse_trac title=""The River"" src=""http://urlnamehere/bitstream/handle/2374.UC/731507/Elliston_Marisa_Crawford_01-10-14_Track_02.mp3?sequence=8"" type=""audio/mpeg"" caption="""" description="""" meta_artist=""Crawford, Marisa & Pendarvis, Jack, 1963-"" meta_length_formatted="""" thumb_src="""" image_width=""300""][wpse_trac title=""Swimming in Lanes Five and Six
I'd like to break it up so that I get one row for each title value and src value, while keeping the same id (930 in this case. Thus:
Row 1:
930 | wpse_trac title=""Indian Summer" | src=""http://urlnamehere/bitstream/handle/2374.UC/731507 /Elliston_Marisa_Crawford_01-10-14_Track_01.mp3?sequence=7"
Row 2
930 | [wpse_trac title=""The River"" src=""http://urlnamehere/bitstream/handle/2374.UC/731507/Elliston_Marisa_Crawford_01-10-14_Track_02.mp3?sequence=8
Place the text in cell A1.
Go to Data tab and select Text to Columns
Choose Delimited and press Next.
Check Other: and key in ] and press Next.
In Destination, select a cell other than A1 and click Finish.
You will see your original text separated into many columns. At this point follow the following steps:
Press Ctrl+H in your keyboard to open the replace text dialog.
In Find what:, enter " type* and click Replace All.
Select all the cells that have the resulting data, copy them and
paste them as Transpose to paste them in rows instead of columns.
Remove the first and last cells (which are not desired)
Complete the desired task with some tiny touches made by you. ENJOY
Try the following formula if your text is in cell A1 and drag the formula down:
=MID($A$1,1,SEARCH(" ",$A$1)-1)&" | "&MID($A$1,SEARCH("£wpse_trac title",SUBSTITUTE($A$1,"wpse_trac title","£wpse_trac title",ROW(A1))),SEARCH("£http:",SUBSTITUTE($A$1,"http:","£http:",ROW(A1)))-SEARCH("£wpse_trac title",SUBSTITUTE($A$1,"wpse_trac title","£wpse_trac title",ROW(A1)))-8)&" | "&MID($A$1,SEARCH("£http:",SUBSTITUTE($A$1,"http:","£http:",ROW(A1)))-6,SEARCH(" ",$A$1,SEARCH("£sequence",SUBSTITUTE($A$1,"sequence","£sequence",ROW(A1))))+10-SEARCH("£http:",SUBSTITUTE($A$1,"http:","£http:",ROW(A1)))-6)
Related
I have a cell which contains data like:
45677|abc|top|IG|pro|sjkdjs|cdf
and i want to extract each one of them into separate columns, is there an excel function that can do this or ill have to use pandas.
Use Data > Text to Columns and set the delimiter to |.
Select the cell or column that contains the text you want to split.
Select Data > Text to Columns.
In the Convert Text to Columns Wizard, select Delimited > Next.
Set the Delimiter to |.
You can see a preview of your data in the Data preview window.
Select Next.
Select the Destination in your worksheet which is where you want the
split data to appear.
Select Finish.
For one row you write how you want it to be.
just like given in above picture.
And then
Select the cell B1
Press CNTRL + E
Follow above 2 steps for each of cell i.e. C1,D1,E1,F1,G1 and H1 and you'll get all the automatically filled with delimiter. Result would be like below img:
I have text in D1:E2. By using macro after clicking button it is copied to the next cells F1:G2. After that user can edit text in F1:G2. Then by pressing the button (with previously described macro) D1:E2 can be copied again so H1:I2 will be prefilled. So by one clicking macro button code is copying D1:E2 to the next available cells. One click F1:G2, second click H1:I2 etc.
Now I need to display all values from D1:E2, F1:G2, H1:I2, J1:K2 in vertical order so:
Text 1 Text 2 Text 3 Text 4 Text 5 etc
Will be:
Text 1
Text 2
Text 3
Text 4
Text 5
etc
What formula would work the best for that situation? It should also skip empty cells and avoid error messages. So if there is no text in H1:I2, J1:K2 it would just skip them.
Note! Cells D1:E2, F1:G2, H1:I2, J1:K2 are merged and wrapped. If it helps I can edit my model to be D1:E1, F1:G1, H1:I1, J1:K1
Excel formula vertical to horizontal
TRANSPOSE function
Step 1: Select blank cells. First select some blank cells. ...
Step 2: Type =TRANSPOSE( With those blank cells still selected, type: =TRANSPOSE( ...
Step 3: Type the range of the original cells. Now type the range of the cells you want to transpose. ...
Step 4: Finally, press CTRL+SHIFT+ENTER. Now press CTRL+SHIFT+ENTER.
And Refer this link may be it will help you
https://www.thewindowsclub.com/transpose-feature-excel-2013
Ok, thanks goes to Scott Craner and original post can be found here https://superuser.com/questions/1213491/.
Solution is to make row height * 2 (so 13*2=26), unmerge cells vertically and use formula:
=INDEX($1:$1;(ROW(1:1)-1)*2+4)
Basically all I want to do is to insert a new column after having filtered my data by a certain criterion, and then insert consecutive numbers into that column, one for each row. I.e., I have data like this in one column:
Armstrong, John
Beattie, Jane
Coombs, John
And I want a new column running next to it so it looks like:
1 Armstrong, John
2 Beattie, Jane
3 Coombs, John
I have tried inputting the first few numbers and then dragging down to fill the rest of the column but when I do that all of the numbers turn to 1 for some reason.
Okay I found the correct answer to this issue here
Here are the steps:
Filter your data.
Select the cells you want to add the numbering to.
Press F5.
Select Special.
Choose "Visible Cells Only" and press OK.
Now in the top row of your filtered data (just below the header) enter the following code:
=MAX($"Your Column Letter"$1:"Your Column Letter"$"The current row for the filter - 1") + 1
Ex:
=MAX($A$1:A26)+1
Which would be applied starting at cell A27.
Hold Ctrl and press enter.
Note this only works in a range, not in a table!
Try this function:
=SUBTOTAL(3, B$2:B2)
You can find more details in this blog entry.
I had the same problem. I'm no expert but this is the solution we used:
Before you filter your data, first create a temporary column to populate your entire data set with your original sort order. Auto number the temporary "original sort order" column. Now filter your data. Copy and paste the filtered data into a new worksheet. This will move only the filtered data to the new sheet so that your row numbers will become consecutive. Now auto number your desired field. Go back to your original worksheet and delete the filtered rows. Copy and paste the newly numbered data from the secondary sheet onto the bottom of your original worksheet. Then clear your filter and sort the worksheet by the temporary "original sort order" column. This will put your newly numbered data back into its original order and you can then delete the temporary column.
Add a column for example 'Selected' First.
Then Filter your data.
Go to the column 'Selected'. Provide any proxy text or number to all rows. like '1' or 'A' - now your hidden Rows are Blank
Now, Clear Filter and Use Sorting - two levels
Sort by - 'Selected' Ascending - this leaves blank cells at bottom
Add Sort Level - 'Any column you Desire' your order
Now, Why dont you drag the autofill yourself.
Oops, I have no reputation here.
I had the same need to fill up a column with a sequence series for each value on another column. I tried all the answers above and could not fix the problem. I solved it with a simple VBA macro.
My data have the same structure (but with 3000 rows):
N2 is the column on which the table is filtered;
N3 is the column where I wanted to fill a series;
A | B
N2 | N3
1 | 1
2 | 1
3 | 1
1 | 2
6 | 1
4 | 1
2 | 2
1 | 3
5 | 1
Here below the code:
> Sub Seq_N3() ' ' Seq_N3 Macro ' Sequence numbering of N3 based on N2 value
> do N2
> Dim N2 As Integer
> Dim seq As Integer
>
> With ActiveSheet
>
> For N2 = 1 To 7 Step 1
> seq = 1 '
> .Range("B2").Select '
>
> Do While ActiveCell.Offset(0, -1).Value2 <> 0
>
> If ActiveCell.Offset(0, -1).Value2 = N2 Then
> ActiveCell.Value2 = seq
> seq = seq + 1
> ActiveCell.Offset(1, 0).Select
> Else
> ActiveCell.Offset(1, 0).Select
> End If
>
> Loop
>
> Next N2
>
> End With End Sub
Hope it helps!
Step 1: Highlight the entire column (not including the header) of the column you wish to populate
Step 2: (Using Kutools) On the Insert dropdown, click "Fill Custom List"
Step 3: Click Edit
Step 4: Create your list (For Ex: 1, 2)
Step 5: Choose your new custom list and then click "Fill Range"
DONE!!!
Easiest way do this is to remove filter, fill series from top of total data. Filter your desired data back in, copy list of numbers into a new sheet (this should be only the total lines you want to add numbering to) paste into column A1. Add "1" into column B1, right click and hold then drag down to end of numbers and choose "fill series". Now return to your list with filters and in the next column to the right "VLOOKUP" the filtered number against the list you pasted into a new sheet and return the 2nd value.
The best option would be using formula =Row()-Row(ColumnHeaderCell) then Apply it to the whole Column [But this not works in filter row number]
Although the methods described in this thread allow sequential numbers to be added to visible cells in a filtered range, the formulas for doing so are likely to break if the cells currently hidden by the filter have existing values. Ideally, you would just copy the filtered range after adding formulas to number them--but you will get a "no can do" message because of the breaks in the selected range. The workaround is to use a currently blank auxiliary column.
The instructions that follow (taken from my answer in an Experts Exchange thread) assume that a filtered range (cells B5:B7147) needs new sequential numbers starting with cell B116.
The overall approach uses F5...Special Cells to select just the cells we care about at the moment. And we will be using an auxiliary column to store intermediate values.
The starting point is with filter applied, and you want to update the numbers in column B starting with cell B116. We will use column K as the auxiliary column. And we note that the data extends through row 7147.
Put 9918 (the next sequential number) in cell K116. Then select the range of cells from K117 to K7147. Now use F5...Special Cells...Visible cells ribbon item to select just the cells in column K that need new sequential numbers. Click in the formula bar and type the formula shown below. Hold the Control key down and hit Enter to put sequential numbers in the visible cells.
`=MAX(K$116:K116)+1`
Now clear the AutoFilter. In the address bar (just above the intersection of row numbers and column letters), type K5:K7147 and hit Enter. This will instantly select those cells without need to drag the cursor down through thousands of rows.
Next, use F5...Special Cells...Blanks to select the blank cells in column K. In cell K5 Control + Enter the formula shown below.
=IF(B5="","",B5)
Use the trick with the address bar to select K5:K7147. Copy those cells. Next, use the address bar trick to select B5:B7147. Now do a Paste Special...Values. You now have the desired numbers in column B without formulas and without any of the originally hidden values being overwritten.
Finally, you may clear (or delete) the auxiliary column K.
Try this:
On first row set value 1 (e.g cell A1)
on next row set: =A1+1
Finally autocomplete the remaining rows
I have a column with some text in each cell.
I want to add some text, for example "X", at the start of all cells. For example:
A B
----- >>>> ----
1 X1
2 X2
3 X3
What is the easiest way to do this?
Type this in cell B1, and copy down...
="X"&A1
This would also work:
=CONCATENATE("X",A1)
And here's one of many ways to do this in VBA (Disclaimer: I don't code in VBA very often!):
Sub AddX()
Dim i As Long
With ActiveSheet
For i = 1 To .Range("A65536").End(xlUp).Row Step 1
.Cells(i, 2).Value = "X" & Trim(Str(.Cells(i, 1).Value))
Next i
End With
End Sub
Select the cell you want to be like this,
Go To Cell Properties (or CTRL 1)
under Number tab
in custom
enter
"X"#
Select the cell you want to be like this, go to cell properties (or CTRL 1) under Number tab in custom enter "X"#
Put a space between " and # if needed
Select the cell you want,
Go To Format Cells (or CTRL+1),
Select the "custom" Tab, enter your required format like : "X"#
use a space if needed.
for example, I needed to insert the word "Hours" beside my numbers and used this format : # "hours"
Enter the function of = CONCATENATE("X",A1) in one cell other than A say D
Click the Cell D1, and drag the fill handle across the range that you want to fill.All the cells should have been added the specific prefix text.
You can see the changes made to the repective cells.
Option 1:
select the cell(s), under formatting/number/custom formatting, type in
"BOB" General
now you have a prefix "BOB" next to numbers, dates, booleans, but not next to TEXTs
Option2:
As before, but use the following format
_ "BOB" #_
now you have a prefix BOB, this works even if the cell contained text
Cheers, Sudhi
Michael.. if its just for formatting then you can format the cell to append any value.
Just right click and select Format Cell on the context menu, select custom and then specify type as you wish... for above example it would be X0. Here 'X' is the prefix and 0 is the numeric after.
Hope this helps..
Cheers...
Go to Format Cells - Custom. Type the required format into the list first. To prefix "0" before the text characters in an Excel column, use the Format 0####. Remember, use the character "#" equal to the maximum number of digits in a cell of that column. For e.g., if there are 4 cells in a column with the entries - 123, 333, 5665, 7 - use the formula 0####. Reason - A single # refers to reference of just one digit.
Another way to do this:
Put your prefix in one column say column A in excel
Put the values to which you want to add prefix in another column say column B in excel
In Column C, use this formula;
"C1=A1&B1"
Copy all the values in column C and paste it again in the same selection but as values only.
Type a value in one cell (EX:B4 CELL). For temporary use this formula in other cell (once done delete it). =CONCAT(XY,B4) . click and drag till the value you need. Copy the whole column and right click paste only values (second option).
I tried and it's working as expected.
original column is like:
0.45::rafas::4.0::0.0::0.9
0.35::rasaf::4.0::110.0::1.0
and i would like to break the string in to the following (:: as separator) in Excel
col1 col2 col3 col4 col5
0.45::rafas::4.0::0.0::0.9 0.45 rafas 4.0 0.0 0.9
0.35::rasaf::4.0::110.0::1.0 0.35 rasaf 4.0 110 1.0
Please help.
This page explains how to do just that using the "Text to Columns" function.
Copied for your convenience:
Highlight all of your cells with the data.
Select The Topmost Cell In The Column, E.G. A1 Hold CTRL+SHIFT And
Then Press The Down Arrow. OK, Once We've Done That, Go To "Data" Menu
And Select "Text To Columns". On The Text To Columns Window, Select
"Delimited" And Then Hit "Next". In The Following Window, Choose
"Other" For Type Of Delimiter And Use The Minus/Hyphen Sign - Hit
Finish.
Now you will have two columns, from your example, the first column
will contain data like "Animals" and the other column will contain the
data " House of The Rising Sun". (note the SPACE in front of "House")
To get rid of that SPACE we're going to use the TRIM function.
In cell C1 (or the column to the right of the song titles) type in
this formula.
=TRIM(B1)
Then double-click on that little black box on the excel cursor to copy
the formula down the whole range. Any spaces at the Start or end of
the text string will be removed.
If you wanted to do it with forumlae rather than the "text to columns" functions you could use:
Assuming string in A1
in B1: =FIND("::",$A1)
in C1: =FIND("::",$A1,B1+1)
Then copy C1 over D1:E1
in F1: =MID($A1,1,B1-1)
in G1: =MID($A1,B1+2,C1-B1-2)
Then copy G1 over H1:I1
And finally
in J1: =MID($A1,E1+2,LEN($A1)-E1-1)
The results of the split will be in F1:J1. You can always hide columns B:E as they are just internal to the splitting. This can then be done on as many rows as you need and if the value in A1 is update all other values will be changed. However, it is on a fixed number of columns but can easily be expanded if needed.
Excel (and OpenOffice) have a functionality to split Text into Columns. Highlight all the columns that conform to this schema, then go to the Data menu, and select "Text to Columns". Used a delimited separator and specify it as ":" while treating consecutive delimitors as one.
Here is a very simple way to extract the 5th character from the left from a text string in Excel:
Suppose the character string ABCDEFGHIJ is stored in cell A1 in an Excel Spreadsheet, then the following formula
=RIGHT(LEFT(A1,5),1)
produces the 5th character from the left in the string, namely “E”.
If you would like a simple function, you can use the following VBA code.
Function SplitTextToNum(rngInput As Range, sepString As String)
Dim CallerRows As Long, CallerCols As Long, DimLimit As Long
Dim outvar As Variant
outvar = Split(rngInput.Value, sepString, -1, vbBinaryCompare)
If Application.Caller.Rows.Count > 1 Then
SplitTextToNum = Application.Transpose(outvar)
Else
SplitTextToNum = outvar
End If
End Function
You can use Ctrl+Shift+Enter over a range of cells after entering the formula referring to the cell in which you have the string that you need to be split up.