I have an excel column with values and "-", and I want to have only the number values in another column.
How can I do?
Here the column
Try This:
Select the respective column, then go to
Data Tab > Data Tools > Text to Columns
Delimited > click next > then check Other tab and enter "-"
then click next and click finish
finally "-" are disappeared
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:
And my future report should contain as below.
Region --> Filter list of Regions
If I select North America
I should be able to display
Country Name
List of states down from here
(non-Null data should be displayed)
( i tried with pivot tables but results are not in expected format)
Here is a guide to using Powerquery to complete the task
1) Turn your source data into an Excel table. Select a cell in the data area and then press Ctrl+ T. Remember to select my table has headers.
2) Go to Get And Transform 2016 or PowerQuery tab (you have to install add-in pre-2016) > New query from table
3) Highlight third column hold down Shift key and then select the end column to highlight all States columns then right click > unpivot columns
4) Select Attribute column > right click > Remove column then select Value column and rename as State
5) Then select Region column > Transform tab > Any Column > Fill > Fill Down
6) Repeat for Country column
7) Top left corner > Close and load to . Here you have number of options which include (there are more ways to create the final pivot):
a) You could create connection only and tick the add to data model check box and then use Power pivot to directly access the new table for a pivot
b) You can close and load to a new worksheet choosing to view as a Table
I will show you option b.
You end up with a flat table in a new worksheet
8) Select a cell within the table and press Alt + N + V to create a new pivottable.
noting the different options you could use for setting up this pivottable.
9) Arrange pivottable as required
No nulls need to be removed in this case. However, you could have selected the down arrow next to the column header of interest and then selected Remove Empty.
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
My requirement is very simple but i am not finding it easy-
In excel, column A is having 'Table name' and column B is having 'Column name'
I want to write a query-
Select * from 'column A' where 'column B' is not null.
In excel I have 2578 lines so I dont want to write 2578 Select statements.
any expert help in Excel?
I doubt this is your answer, but may help towards what you want. Based on #user3514930's approach:
With data as in the top left corner, select the two columns and click on DATA > Sort & Filter - Filter. Click on the arrow in the Column name cell and on (Blanks) in the dropdown. You should then see the equivalent of what is in the lower range. This can be copied and pasted elsewhere in the sheet, if you wish.