How to transpose column in several rows in excel - excel

is there a way to transpose one column in excel into several rows. For example I have one column with 100 rows and I want to transpose it but also split it in several rows with 3 columns.
I have this:
21
34
2
56
23
12
34
18
22
...
I need this:
21 34 2
56 23 12
34 18 22
...
Thank you very much in advanced!

You could try this:
The formula used in C1 translates to:
=INDEX($A$1:$A$9,ROW(A1)*3-3+COLUMN(A1))
You can drag it sideways and down.

Related

Replace and update columns in excel

Table
A B C D E
1 Jan Feb Mar Apr Jun
2 24 32 64 54 45
3 66 76 76 76 87
4 45 65 84 67 23
the last 3 columns should automatically update in another column as
Last 3 moths data
AN AO AP
1 Month1 Month2 Month3
2 64 54 45
3 76 76 87
4 84 67 23
If I add another column in the first table as july in columns F. Then it should automatically replace the data in Month3 in second table and month3 data sholud move to month2 and month2 to month1.
=IF(AN2="",AL2,IF(AO2="",AM2,IF(AP2="",AN2,IF(AQ2="",AO2,IF(AQ2<>"",AP2,IF(AP2<>"",AO2,IF(AO2<>"",AN2,IF(AN2<>"",AM2,""))))))))
The formula is simlar to the another columns.
With any version of Excel:
You can detect where the columns end using many methods - the simplest is using Count.
Enter the following into the top left of your result table:
=INDEX(2:2,,COUNT(2:2)-2)
This counts the number of cells with data in, and returns the data from that numbered column (offset to the left by 2). In the next cell to its right, change the -2 to -1. In the last cell, change the -1 to -0 or remove that part entirely.
Then copy the cells down to match your source table.
If you have Excel-365 then use below formula.
=INDEX(A1:Z4,SEQUENCE(ROWS(A1:A4)),SEQUENCE(1,3,MAX(IF(A1:Z1<>"",COLUMN(A1:Z1),""))-2))
If you don't have Excel-365 then use below formula then drag down and across as required.
=INDEX($A$1:$Z$4,ROW($A1),MAX(IF($A$1:$Z$1<>"",COLUMN($A$1:$Z$1),""))-3+COLUMN(A$1))
If you have ms365, try to use FILTER(), for example:
Formula in G1:
=FILTER(Table1[#All],COLUMN(Table1[#Headers])>COLUMNS(Table1[#Headers])-3)
If you add columns:
If you remove columns:

Counting combinations of values in table of values excel?

I have a table of values with each value in a different cell
e.g.
2 9 12 19 41 45 14 39
12 14 19 27 39 40 30 44
6 9 13 15 16 41 7 20
8 16 14 34 13 44 5 15
10 11 20 24 27 36 9 41
Is there a way to find which pairs of numbers are most common.
i.e.
13 & 15 appear 2 times
14 & 44 appear 2 times
24 & 27 appear 1 time
I was hoping for a formula as the table has over a hundred rows in it so would be time consuming to count manually.
The formula you would want would be the one for the row totals of a pair of numbers in A2 and B2:
=SUM(MMULT(--($E$2:$L$6=A2),TRANSPOSE(COLUMN(E:L))^0)*MMULT(--($E$2:$L$6=B2),TRANSPOSE(COLUMN(E:L))^0))
entered as an array formula using CtrlShiftEnter
There will be formulas for for listing distinct pairs up to a certain number out there - I used
=IF(ROW()=2,1,IF(B1<45,A1,A1+1))
for A2 and
=IF(B1<45,B1+1,2+COUNTIF(B$1:B1,45))
for B2.
If you scroll down this list you can see that 13,16 occurs twice as well as 13,15.
9,41 occurs three times.
Note - I am assuming the numbers are like lottery numbers and any one number can only occur once in a row. The formula could easily be modified to account for duplicates within a row.

EXCEL: Sum columns based on common index

I'm trying to sum columns that have a common index but the difficulty is that the index is not in the same row.
Here is an example
DayIndex2018 Value2018 DayIndex2017 Value 2017
empty empty 1 20
1 50 2 45
2 60 3 55
3 70 4 33
4 32 5 23
What I would like is to have the sum of "value 2017" for indexes that are in common with indexes for 2018: 20 + 45 + 55 + 33
I though of doing this with a sumif but rows need to be perfectly aligned.
Any idea of how I could do this?
Thanks
Use sumproduct to sum the array of sumif
Formula in cell F2:
=SUMPRODUCT(SUMIF(C2:C6,A2:A6,D2:D6))

Excel table formulas to return blank

I have a table in excel with 2 columns, the E column is the running total the D column is the input value so normally it would be = E15+D16 however, i want the E column to return a blank if nothing is entered in the D column- what formula do I need?
1 Nov-23 Nov-30 1,230 1,230
2 Dec-01 Dec-07 130 1,360
3 Dec-08 Dec-14 416 1,776
4 Dec-15 Dec-21 124 1,900
5 Dec-22 Dec-28 102 2,002
6 Dec-29 Jan-04 83 2,085
7 Jan-05 Jan-11 95 2,180
8 Jan-12 Jan-18 88 2,268
9 Jan-19 Jan-25 102 2,370
10 Jan-26 Feb-01 130 2,500
11 Feb-02 Feb-08 311 2,811
12 Feb-09 Feb-15
13
14
15
16
17
18
19
20
21
22
=if(D16="","",E15+D16)
You dont even need the ISBLANK, just use empty quotes.
ISBLANK is what you're looking for.
In E16 =IF(ISBLANK(D16), "", E15+D16)
Use If and IsBlank in conjunction.
Do a check to see if the cell is blank, then depending on the result do the sum or the return blank. I don't have excel in front of me atm, but it should go something like this:
=if(ISBLANK(D16), "", E15+D16)
You can drag this down starting from the second cell in the column where this running total lives. The first one is obviously just the value from the adjacent cell.

divide data in one column into more column in excel

i want to do this in Microsoft Excel 2007
This a one column. I have 20098 data in one column like below.
1
2
3
4
5
6
7
8
131
1
31
31
31
31
41
I want to rearrange those data like this how can i do it
1 4 7 1 31
2 5 8 31 31
3 6 131 31 41
If your data was in column A then in cell B1 put
=OFFSET($A1,3*(COLUMN()-COLUMN($B$1)),)
and copy down and right to split your data as desired
use this formula in all 3 rows and 6700 columns of the resulting range:
=INDEX($A:$A;(COLUMN()-first_column)*3 + ROW()-first_row+1)
where first_column is =column(..) and first_row is =row(..) of the cell where you want to have the 1st value
e.g. if you use B1:IWS3 range to list the results, the formula will be:
=INDEX($A:$A;(COLUMN()-2)*3 + ROW())

Resources