Transpose Columns in Order using Excel VBA - vba

I have an extremely large amount of data needs to be transposed in order using the example on the image below. The left side of the image is how the information comes from the report, and the right side is what I need it to look like.
I have tried to use the Transpose paste special but it results in 3000+ columns of information. I have also tried pivot tables but I get the information out of order.
The three pieces of "Info" are per employee. As it stands now, the lines are vertically but in our end result we should have three rows per employee.
Transpose Left Original Data Right Outcome Needed

you can achieve this by the below formula
F1 = INDEX($A$1:$A$3,1+QUOTIENT(ROW()-ROW($F$1),3))
G1 = VLOOKUP(F1,$A$1:$D$3,2+MOD(ROW()-ROW($F$1),3),FALSE)
So if you have 3000 lines of data, the formula should be dragged to 9000 rows.

Related

how to bing the grouped items to a non group section of a tablix

I need to have a graph the same size as tablix. Since i cant merge the cells , how can i bring the grouped items to the left ?
i have this
Before
and i want it to look like this:
After
But since the period is a group i cant merge the cells in the bottom, So is there a way to bring period colums to the left.
Thanks
If your chart and table use the same dataset (and why wouldn;t it if it showing the same data), you can put them in a list that will grow with the column grouping of your current table.
INSERT a new List. A list is really just a table.
Add an extra row to the list in the same group.
Set the Grouping on the list to Group By 1 (the number one). This will group everything to one line.
Set the dataset to the same dataset as your chart and table.
Set the list's top cell's size to match your table.
Put the table in the top row.
Set the bottom cell to the height of the chart.
Put the chart in the bottom.
The column grouping in the top will stretch out the list and the chart will go with it.

Google Sheets QUERY(): Add Additional Blank Rows

I'm studying how Major Events affect the US and AU stock markets, such as the Dotcom bubble, 911, COVID etc.
Using GoogleFinance(), I'm trying to compare the weekly close for the S&P500 Index (INDEXSP:.INX) and the ASX All Ords Index (INDEXASX:XAO) for various time periods, for example 2000-2010.
However, the ASX All Ords only returns records from 2010-04-20, which is a problem as I'd like to display the data as a Chart.
The following is one of the functions that return the data:
=QUERY( googlefinance(E10,"all",$F7,$F8,"WEEKLY"), "SELECT Col1, Col5 LABEL Col1 'All Ords', Col5 'Value' ")
I'd like to add extra blank rows for the ASX data so the weekly dates line up. In the case of the range 2000-2010, I need to add 67 blank rows to align dates.
Is there any way to structure the Query, such as adding a UNION clause somehow, to achieve this? Or any alternate method?
You'll want to use a vlookup function of the dates on the S&P results INTO the array of the ASX results.
I've laid out the basics here on this spreadsheet that was created specifically for this thread.
the formula I'm talking about is in cell D4 on the tab called Comparison. I rounded the dates so that the chart is cleaner.
=ARRAYFORMULA(IFERROR(VLOOKUP(B4:B,QUERY(ROUND(GOOGLEFINANCE(D3,"close","1/1/1990",TODAY(),"weekly"),{0,2}),"offset 1",0),2,TRUE)))

How to record a macro in Excel that works on any number of rows?

I have recorded a macro in Excel that sums B2 and C2 into D2. I clicked on the lower right corner of D2 to extend the computation onto all rows.
Now, when I use this macro on other tables, it computes always the same number of rows as in the original table.
How can I record the macro so that it recognizes the height of the table and acts accordingly?
Is this possible without VBA programming?
You might be able to do that using the OFFSET() formula and avoiding a macro.
OFFSET(reference, rows, cols, [height], [width])
These two give the same result.
=SUM(B2:C2)
=SUM(OFFSET(B2,0,0,1,2))
You could count the rows in the table and use that to feed the height of your OFFSET formula.
=SUM(OFFSET(B2,0,0,1,COUNT(B:B))

Excel - Loop through rows and reverse order

I was looking for a code that loop through all rows (I got too many), and change order for every three rows. I have a form of rows like this...
see image
Need to loop through all rows in column B and reverse order for every three rows and get this (for better analysis). Thank you
see image
If I understand your question correctly, type this formula into a cell in column B and drag down as far as necessary:
= INDEX(A:A,ROW()+2*(1-MOD(ROW()-1,3)))
VBA is not needed. This formula copies the values from column A to column B, but reverses the order of the entries every three rows as shown in your example image from your question.
See below.

Filter if one or another value is equal to cell

I need to solve one simple problem. I do have a one huge table that contains around 300000 rows with data and basically what I need is to filter out row if the cell in either G or L row is equal to cell in 'Input sheet'!C2.
Please see attached image.
So if the either G column or L column is containing value from cell then I want to copy entire row into sheet called 'Direct'. The 'Direct' will not contain empty rows.
As It is huge amount of data, that will grow a bit the code must be a bit optimized.
Many thanks in advance!!!
Cheers,
F.