How to rotate excel data - excel

This is a general question that just popped into my head that I have always wondered. There have been several times when I've needed to rotate data in Excel, for example:
Starting with:
| A | B | C |
----------------------
1 | ABC | DEF | GHI |
----------------------
2 | omg | lol | xyz |
----------------------
3 | | | |
----------------------
transform into:
| A | B | C |
----------------------
1 | ABC | omg | |
----------------------
2 | DEF | lol | |
----------------------
3 | GHI | xyz | |
----------------------
I have never found a reasonable way to do this. Solutions I can think of right now are:
Write a macro (yuck)
Manually copy / paste (yuck)
Maybe some pivot table magic? (i doubt this would be possible)
Clever formulas using INDEX
Are there other solutions, maybe some hidden built-in feature?

Copy your grid
Edit ▸ Paste Special...
Check the "Transpose" checkbox
Click "OK"

Use of the TRANSPOSE() function

Transposing rows and columns?
See:
http://office.microsoft.com/en-us/excel-help/rotate-data-by-converting-columns-to-rows-or-vice-versa-HP005203138.aspx

Construct a pivot table from the data then you can transpose and do a lot more besides (filter, group etc)

Related

How to populate columns using values from multiple rows of another sheet (Excel)

I'm not sure what to search for this.
Basically, say I have a sheet that looks like this:
A | apple | 1
A | aardvark | 1
A | alternate | 3
B | bear | 2
B | banana | 4
C | candy | 3
C | carnivore | 2
and I want to copy values into another sheet so that it looks like this:
A | apple | 1 | aardvark | 1 | alternate | 3
B | bear | 2 | banana | 4 | |
C | candy | 3 | carnivore | 2 | |
I know there's the lookup function, but I'm not sure how to make it select the first, second, third etc. instance of what's being referenced.
Thanks in advance for any help.
For the screenshot below, use the following formulas:
E2: =IFERROR(INDEX($A$1:$A$8,MATCH(E1,$A$1:$A$8,0)+COUNTIF($A$1:$A$8,E1)),"")
F2:
=IF(INT(COLUMNS($F$1:F$1)/2)<COUNTIF($A$2:$A$8,$E2),INDEX($B$2:$B$8,MATCH($E2,$A$2:$A$8,0)+INT(COLUMNS($F$1:F$1)/2)),"")
G2:
=IF(INT(COLUMNS($G$1:G$1)/2)<COUNTIF($A$2:$A$8,$E2),INDEX($C$2:$C$8,MATCH($E2,$A$2:$A$8,0)+INT(COLUMNS($G$1:G$1)/2)),"")
Select F2 and G2, and fill to the right as far as you need, then fill the entire table down as far as you need.

Excel, How to use average with indirect?

I've been trying to use AVERAGE with INDIRECT but keeps giving me errors.
Now I am using Average like this:
AVERAGE(Results!C2:C51)
I need to get data from another sheet "Results". But in my current sheet I got the range of the rows set in two cells.
+-------------------+
| ... E F |
| +-------+-------+
| 2 |...| 2 | 51| |
| +---------------+
| 3 | | 52|101| |
| +---------------+
| 4 | | | | |
+---+---+---+---+---+
I've tried like this, but it's not working:
AVERAGE(Results!INDIRECT("C"&E2):INDIRECT("C"&F2))
This should do it:
=AVERAGE(INDIRECT("Results!C"&E2&":C"&F2))
The answer posted by zipa is correct. Here is an alternaive that will allow you to avoid INDIRECT() entirely:
=AVERAGE(INDEX(Results!C:C,E2):INDEX(Results!C:C,F2))
This is based on Scott Craner's Answer to a question I asked previously.

Excel 2010 Calculating Production line quantities without long calculations

Program: Excel 2010
Requirements: Prefer no VBA (Macro free book)
I am creating a spreadsheet to calculate items required for components (parts). I have a list of the product, and under the number of specific parts. I have a calculation which tells me what the total parts are needed, but, is there a better way?
=($C$32*C34)+($D$32*D34)+($E$32*E34)+($F$32*F34)+($G$32*G34)+($H$32*H34)+($I$32*I34)+($J$32*J34)+($K$32*K34)
| A | B | C | D | E | F |
| Making: | | 2 | 2 | 2 | |
|---------------|-------|------------|-------------|-----------------|---------|
| Item -> | Total | Small raft | Rowing boat | Sm sailing boat | Corbita |
| | | | | | |
| Planks | 20 | 4 | 6 | | |
| Logs | 8 | 4 | | | |
| Nails - Large | 16 | 8 | | | |
| Oars | | | | | |
In the above, you can see that ($C$32*C34) = 8 & ($D$32*D34) = 12 => 12+8 = 20 (B34) (Planks Total)
Is there an easier way of doing this, or will my equation just keep getting bigger?
Thanks in advance.
As chris neilsen mentioned in his comment, you can use the SUMPRODUCT function in Excel. The formula in your cell B34 (total planks) should look like this:
=SUMPRODUCT(C32:K32,C34:K34)
This has the effect of multiplying the corresponding components in the given ranges (C32 * C34, D32 * D34, etc.) and then returning the sum of those products/multiplications.
As you add more columns, you can expand K to the last column in the range that you want to add up in both ranges.

Kind of group by in Excel without VBA

I need another transformation help in Excel
| A | B |
---| ----|--------|
1 | ID | Course |
2 | 1 | A1 |
3 | 1 | A2 |
4 | 2 | A1 |
5 | 3 | A2 |
I want to have a kind of group by, i.e.
| A | B | C |D | ...
---| ----|---------|---------|---------|----
1 | ID | Course1 | Course2 | Course3 | ...
2 | 1 | A1 | A2 | | ...
3 | 2 | A1 | | | ...
4 | 3 | A2 | | | ...
Any ideas? Is it possible without VBA macro?
I believe that the following link on removing duplicates from column would suit your needs (in your case you would do it horizontally).
http://www.get-digital-help.com/2009/03/30/how-to-extract-a-unique-list-and-the-duplicates-in-excel-from-one-column/
Per your reply to Robert, if you want to do it without VBA, try this... Select all cells in the first column. Copy and paste them into the first column of another worksheet. Use Excel's Remove Duplicates function on the pasted data. Then use INDEX functions in the columns to the right in order to pull the first, second, etc values matching that first column value.

Excel Combining Multiple Rows

I feel like I am missing something simple I would like to do with Excel but I am asking the question incorrectly on Google...here it goes.
I'm taking a look at some Excel sheets for a friend who runs a race timing company. At the end of a race he has an excel sheet with the following format for a series of races
Name | Gender | Age | Race 1 | Race 2 | Race 3
Bob | M | 20 | 1 | |
Al | M | 24 | 2 | |
Bob | M | 20 | | 2 |
Al | M | 24 | | 1 |
::Assume we don't care about time right now, just place::
I would like to do "something" (again I'm not sure what the proper term is, merge in Excel actually merges two adjecent cells together), where I can get the final output such that
Name | Gender | Age | Race 1 | Race 2 | Race 3
Bob | M | 20 | 1 | 2 |
Al | M | 24 | 2 | 1 |
I'm not sure how to collapse the data for the like rows together.
I'm not opposed to writing a little VBA, but I am thinking this is a built in Excel function but I'm not sure what it is called or how to make it "dance".
Thanks!
PivotTable.
The data format is making life a bit more difficult than it needs to be. Rather than having individual columns for race #1, race #2, race #3 etc, it would make life easier to have a column called "Race Number" and arrange the data like this:
Name | Gender | Age | Race Number | Place
Bob | M | 20 | 1 | 1
Al | M | 24 | 1 | 2
Bob | M | 20 | 2 | 2
Al | M | 24 | 2 | 1
This would make things like PivotTable (as suggested by Jason) a lot easier to work with

Resources