Select a Large Number of Individual Cells in Excel - excel

In addition to a single cell, Excel allows you to select multiple unconnected cells independently by pressing ctrl when clicking the cells.
I use this feature to insert a row between each existing row, which is my ultimate goal. You can do this by independently selecting one cell in each row and then right-clicking and inserting rows.
This process works fine for tens of rows, but in some cases, I need to independently select 1000+ cells in a column to insert a row between each row in a large sheet. To be clear, I'm not talking about ranges. Instead of A1:A1000, I mean to select A1,A2,A3...A1000.
Is this possible without manually clicking each cell?

Insert a helper column with even numbers this way
type the value 2 into the first row
type the value 4 into the second row
select the two cells and double click the fill handle to fill down to the last row of your data or drag to the desired point.
Below your data, in the same column, enter odd numbers 1,3,5,etc, using a similar technique.
Next, sort your data by the new column.
Viola! Blank rows between all rows of data.

Related

Is there a way to duplicate a cell as an inserted row (one row below the target cell) for each line of text in the target cell?

I am spinning my wheels on this... Is there a way to duplicate a cell as an inserted row (one row below the target cell) for each line of text in the target cell? Is there a way to duplicate a cell as an inserted row (one row below the target cell) for each line of text in the target cell?
So I have this cell. I have hundreds of them:
1010101010
1010110101
10001010101010
101001010101010
101010101010010
10101010101010
101010011010
It is in a row with other formatting and columns. Just some minor things like counting char length.
I want to take each line there in the binary cell, duplicate it, and insert it sequentially from the top down one row underneath itself. Excluding the first line. So starting on the second line I need to insert a row for each line.
Is there a way to automate this for the entire sheet with a function? I have been trying to find a way.
I am new to excel programming and functions so any help at all or a point in the right direction even would be very appreciated.
Even a way to do it cell by cell would be better. A VBA code perhaps to add a row below the row with multiple lines of text for each line of text. Have the text in those rows starting with the second line of text in the first below the cell we are breaking up. I can then remove the rest of the lines manually or if the code can sweep them that would work to.
I need to break them out like this. It takes me extremely long to add the rows manually because of the amount of data in the file that needs to be calculated.
This cannot be done with a function, since a function only returns a value to a cell. It does not change the structure of a worksheet.
You can do this with code, which might take some time to write, but if it's a one-off, you can also do it without code.
work out how many rows of data you have, for example by jumping to the end of the column. Say you have 100 rows.
insert a column before column A and in the new column A manually type the numbers 1 and 3 into cells A2 and A3 (I assume row 1 has a label. If not, start in cell A1)
double-click the Fill Handle to fill the number sequence all the way down. It should have the numbers 1,3,5,7,9, etc in the column, ending at 199.
below the last row of data, without leaving a gap, put the numbers 2 and 4 into the next two rows.
using the fill handle or your preferred method of filling down, complete the series until you get to 200, i.e. create a series with 100 rows below the 100 rows of data.
you will now have in column A the series 1,3,5,7 up to 199, followed by 2,4,6,8 etc, up to 200.
Select all the columns and sort by column A
Now every other row is blank. To duplicate the cell from the row above
select column B, or whichever column contains the values you want to duplicate
hit F5 to open the Go To dialog
click Special
Tick Blanks and OK
now all blank cells in the column are selected and cell B3 (if B1 has labels) is active.
without moving the selection, type a = sign
use the Up Arrow key on the keyboard. The cell now contains the formula =B2
hold down the Ctrl key and hit Enter
Now all previously selected blank cells have a formula that shows the value from the cell above. You can now use Copy / Paste Values to paste the results over the formulas and continue with your work. Remove column A, which is no longer required.

Excel - Merge Multiple Columns Cells into a single Cell

I have an Excel spreadsheet in the usual fashion. That is to say, rows and columns. So if there are seven rows, each column has seven values. I want to take one of these columns and make it extend down across the whole spreadsheet. TRANSFORMATION (LOGIC) used to have seven values, now it has one. How do I do this? EDIT: By "down across", I mean the column should have just one cell.
In order to achieve the merging of your cells, select the desired cell range on your sheet and then you will click the "Merge" button found on the Home tab in Excel.
Note that if the content is already in the cells it will take the value from the first cell which has content in it already, so best to copy your values and such out first if you would like to preserve them.

Count the number of orders in the order table

I just needs some help on a formula to count the numbers of orders in the orders table for each customer.
Table Name = "Orders"
See the image:
So in another worksheet, the formula counts the orders for each individual customer.
I countn't get the countif to work as each amount of orders vary between customers. The PivotTable didn't work either as there are blank spaces in the customer numbers.
Any other solutions to my problem?
Quick way to fill the blank cells:
Select the cells from A5:C5 and all the way down the table
Hit F5
Click Special
Tick "Blanks" and hit OK
All blank cells in the range are now selected. Without changing the selection,
type a = sign
hit the up arrow key on your keyboard.
Hold down Ctrl and hit Enter
Now all previously blank cells contain a formula that references the cell right above. Copy the columns and paste them over themselves with Paste Special > Values to replace the formulas with the values.
Now you can build a pivot table for the count.
As an alternative to filling in the blank cells you could use a helper column with a formula along the lines of
=IF(LEN(B5)=0,H4,B5)
Start the formula in cell H5 and copy down. Now you can use a pivot table with this helper column. You can hide the helper column if it upsets your spreadsheet design.

Efficiently update (growing) columns of data+formulas, w/ automatically updated rows of data

I have columns of data, each cell is a formula referencing data from several rows on another sheet (based on a dropdown box).
I now need to update many columns at once and simply copying the formula down into the next cell in the column, Excel tries to match the 'wrong' cells - the column is going down, the rows are going across, meaning I'd have to type in the correct cells manually every time I copy down this formula.
The rows are updated daily with pulled data/VBA and I can't touch the formatting of the columns either.
Not sure how to do this quickly. I have dates placed down each row/column, if that could be used somehow.
Shown: 2 different sheets, example of 2 rows a single cell will reference. There are many of these rows and columns. This is the formula:
=IF($B$7=1,'xx'!L619,IF($B$7=2,'xx'!M619,IF($B$7=3,'xx'!N619,IF($B$7=4,'xx'!Q619,IF($B$7=5,'xx'!Q619,0)))))
When copying the cells down, the formula updates L619, M619... with L620, M620... when instead I'd need P619, Q619...
This may help if you adapt it to your situation:
You can use the OFFSET or INDEX functions to set your spreadsheet up in such a way to transpose a horizontal row of data into a vertical column of data (and be able to drag the formula).
The trick is, you need a column (you can even hide it) with your increments in the cells i.e. 0,1,2,3,4,5,6,7...n
For example:
A1:A101 are where my increment values from 0 to 100 are.
my horizontal data starts at E15, and continues on with F15, G15, H15, etc.
This is my formula:
= OFFSET($E$15,0,$A1)
When I drag this down in a column, it corresponds exactly to the horizontal rows of data. The same thing can be done using INDEX.
Your situation sounds a little more complicated, but you might be able to build on this to suit your needs.

Excel: Agregate multiple tables separated by title

I have an excel file generated by SAP. I need change its format from multiple tables separated by a title to one single table. This is the original table:
and i need it to look like this:
Im new to excel, so i dont have a clue how to do it.
I cant do it manually becuase the file has 5000+ rows.
Any guidance?
I usually use the generic formula:
=IF(XX="",YY,XX/ZZ)
Where XX is a cell you can use to identify a header to append to the individual transactions and YY is the cell directly above the cell you have put your formula. XX is when you need that value itself, ZZ is another value. You'll understand when you apply it.
For instance, here, you could use cell D5 to do this. I would insert two columns before column D (the value of cell D5 is now in cell F5), and put this formula in cell C5:
=IF(F5="",C4,B5)
I will then fill the formula down. This carries the Material ID everywhere down to the last row. There are two quick ways to do this in a file of this type:
Copy the formula, scroll to the bottom of the sheet, hold Shift and click the last cell in the column, then paste.
Select the cell containing the formula, scroll to the bottom of the sheet, hold Shift and do Ctrl + ,D.
In cell D5, I would put the formula:
=IF(F5="",D4,F5)
And fill it down as well to get the material description.
Now for the size per unit, you can create a column to the right of column K (column K now has 'Size per Unit' since we inserted two columns earlier), and put this formula in cell L6:
=IF(K6="",L5,K6)
Fill it down to get it everywhere.
Now, to finish it up, select the whole sheet and copy/paste values (Paste Special > Paste Values) to remove the formulae. Delete rows 1 and 2, put a filter and sort by a field such as the column 'Metric'. Go to the bottom and delete the no longer needed rows.
As a bonus, if you need to make absolutely sure that the order of the transactions is the same as initially, insert a column somewhere, put sequential numbers into it; that is the first cell in the column has 1, the second 2, then 3 etc and fill to the bottom. Be sure that it is in the filter when you delete the unneeded rows, and sort by this column when you are done.
5000+ rows is still good though, I've had to deal with 10+ workbooks each with ~90000 rows once ;)

Resources