ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Convert column to array? (https://www.excelbanter.com/excel-discussion-misc-queries/127880-convert-column-array.html)

James Silverton

Convert column to array?
 
Some of the discussion on unique integers made me try to think
of a method to convert a column to an array. I could not come up
with any easy method. A Google search produced
http://www.cpearson.com/excel/excelF.htm , where there was a VBA
method to do the reverse: convert an array to a column. I
suppose I could adapt the method for what I want but, not
wanting to reinvent the wheel, has anyone any good suggestions?

James Silverton
Potomac, Maryland

E-mail, with obvious alterations:
not.jim.silverton.at.comcast.not


vezerid

Convert column to array?
 
James,
what do you mean exactly? Generating an array constant from a range? Or
take a 1-dimensional array and create a 2-dimensional from this?

HTH
Kostis Vezerides

On Jan 26, 7:42 pm, "James Silverton"
wrote:
Some of the discussion on unique integers made me try to think
of a method to convert a column to an array. I could not come up
with any easy method. A Google search producedhttp://www.cpearson.com/excel/excelF.htm, where there was a VBA
method to do the reverse: convert an array to a column. I
suppose I could adapt the method for what I want but, not
wanting to reinvent the wheel, has anyone any good suggestions?

James Silverton
Potomac, Maryland

E-mail, with obvious alterations:
not.jim.silverton.at.comcast.not



James Silverton

Convert column to array?
 
"vezerid" wrote in message
ps.com...
James,
what do you mean exactly? Generating an array constant from a
range? Or
take a 1-dimensional array and create a 2-dimensional from
this?

HTH
Kostis Vezerides


Thanks for the quick feed-back! It's the latter; I was using
column and 1-d array as synonyms.



--
James Silverton
Potomac, Maryland


vezerid

Convert column to array?
 
OK then, say your 1D is in A1:A12, and also say that you want to
produce a 4row-3col output. We are interested in the number 3. If your
2D starts at C1 then use the following formula:

=INDEX($A$1:$A$12,(ROW()-ROW($C$1))*3+COLUMN()-COLUMN($C$1)+1)

HTH
Kostis

On Jan 26, 8:05 pm, "James Silverton"
wrote:
"vezerid" wrote in glegroups.com...

James,
what do you mean exactly? Generating an array constant from a
range? Or
take a 1-dimensional array and create a 2-dimensional from
this?


HTH
Kostis VezeridesThanks for the quick feed-back! It's the latter; I was using

column and 1-d array as synonyms.

--
James Silverton
Potomac, Maryland



James Silverton

Convert column to array?
 
Hello, vezerid!
You wrote on 26 Jan 2007 09:22:38 -0800:

v =INDEX($A$1:$A$12,(ROW()-ROW($C$1))*3+COLUMN()-COLUMN($C$1)+
v 1)

v HTH
v Kostis

Thanks very much Kostis! That does the job smoothly for a 3
column array. I had a suspicion that INDEX might be involved but
I was not very familiar with the function.

Incidentally, the method can readily be adapted for producing an
array of unique integers as was asked earlier by someone else
since producing a column of unique integers is easy.

James Silverton
Potomac, Maryland

E-mail, with obvious alterations:
not.jim.silverton.at.comcast.not



All times are GMT +1. The time now is 04:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com