excel - How to exchange multiple columns -


using microsoft excel 2010, have spreadsheet containing data 5 different datafiles (each having 14 columns, 70 columns together). need do, sort these columns in fashion: 1.,15.,29.,43.,57.,2.,16.,...etc.

basically, need first columns 5 datafiles in row, second columns etc. there way in excel how write sequence? tried substitute, address , indirect, without results. can write manually, need different spreadsheets well, thought might handy have actual command it.

start using following formula in final spreadsheet:

=index({"sheet1";"sheet2";"sheet3";"sheet4";"sheet5"},mod(column()-1,5)+1) 

if paste formula on each column of final spreadsheet, cycle sheet1 sheet5 column a e etc. write name of files , spreadsheet target in it, , serve base of formula reference.

the formula works follows: modulo applied on column index value, numbers 1 5 used index 1 item constant array.

now base of cycling through spreadsheets, need group of 5 columns a, 5 columns b, etc. use this:

=quotient(column()-1, 5)+1 

now can combine them address:

=address(row(),quotient(column()-1, 5)+1,1,1,index({"sheet1";"sheet2";"sheet3";"sheet4";"sheet5"},mod(column()-1,5)+1)) 

if paste , extend formula on range a1:j3, these addresses:

sheet1!$a$1 sheet2!$a$1 sheet3!$a$1 sheet4!$a$1 sheet5!$a$1 sheet1!$b$1 sheet2!$b$1 sheet3!$b$1 sheet4!$b$1 sheet5!$b$1 sheet1!$a$2 sheet2!$a$2 sheet3!$a$2 sheet4!$a$2 sheet5!$a$2 sheet1!$b$2 sheet2!$b$2 sheet3!$b$2 sheet4!$b$2 sheet5!$b$2 sheet1!$a$3 sheet2!$a$3 sheet3!$a$3 sheet4!$a$3 sheet5!$a$3 sheet1!$b$3 sheet2!$b$3 sheet3!$b$3 sheet4!$b$3 sheet5!$b$3 

eventually wrap formula indirect actual data:

=indirect(address(row(),quotient(column()-1, 5)+1,1,1,index({"sheet1";"sheet2";"sheet3";"sheet4";"sheet5"},mod(column()-1,5)+1))) 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -