If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Copying a column list from one sheet to another and repeating???
Hi
Does anyone know how to copy a list of text in a column from one sheet and display it in another sheet but then continue to repeat the original list? I am trying to get the content from these cells to be displayed in a row of cells but the crucial thing is that I need the cells to repeat the list from the beginning once a blank cell is reached in the original column. I'll try an example to make this clearer... 1. There is Sheet A with column A1:A20 containing the names of 20 products. 2. There is Sheet B with row A1:AN1 containing 40 cells In this example Sheet B should copy all the 20 product names then get to cell 21 and find a blank cell at 'Sheet1:A21' so start the list from the beginning again. This should occur no matter how many cells are calling the original list of 20 products but as soon as it finds a blank cell at the end of the list of 20 products it should go back to the beginning and start displaying from cell 1. Please note that there should be no limit on the number of cells in the original product list and the cells displaying the copied list should be able to be displayed in any row on sheet 2. Hopefully I've made it easier to understand and not harder. Any ideas would be much appreciated. Thanks Simon |
#2
|
|||
|
|||
Copying a column list from one sheet to another and repeating???
=OFFSET(Sheet1!$A$1,IF((MOD(COLUMN(),$A$1)=0),(COU NTA(Sheet1!$A:$A)-1),((MOD(COLUMN(),$A$1))-1)),0)
"simon" wrote: Hi Does anyone know how to copy a list of text in a column from one sheet and display it in another sheet but then continue to repeat the original list? I am trying to get the content from these cells to be displayed in a row of cells but the crucial thing is that I need the cells to repeat the list from the beginning once a blank cell is reached in the original column. I'll try an example to make this clearer... 1. There is Sheet A with column A1:A20 containing the names of 20 products. 2. There is Sheet B with row A1:AN1 containing 40 cells In this example Sheet B should copy all the 20 product names then get to cell 21 and find a blank cell at 'Sheet1:A21' so start the list from the beginning again. This should occur no matter how many cells are calling the original list of 20 products but as soon as it finds a blank cell at the end of the list of 20 products it should go back to the beginning and start displaying from cell 1. Please note that there should be no limit on the number of cells in the original product list and the cells displaying the copied list should be able to be displayed in any row on sheet 2. Hopefully I've made it easier to understand and not harder. Any ideas would be much appreciated. Thanks Simon |
#3
|
|||
|
|||
Copying a column list from one sheet to another and repeating?
=OFFSET(Sheet1!$A$1,((MOD(COLUMN(),(COUNTA(Sheet1! $A:$A)))=0)*6)+(MOD(COLUMN(),(COUNTA(Sheet1!$A:$A) )))-1,0)
Better... eliminates the IF "klswvu" wrote: =OFFSET(Sheet1!$A$1,IF((MOD(COLUMN(),$A$1)=0),(COU NTA(Sheet1!$A:$A)-1),((MOD(COLUMN(),$A$1))-1)),0) |
#4
|
|||
|
|||
Copying a column list from one sheet to another and repeating?
=OFFSET(Sheet1!$A$1,((MOD(COLUMN(),(COUNTA(Sheet1! $A:$A)))=0)*(COUNTA(Sheet1!$A:$A)))+(MOD(COLUMN(), (COUNTA(Sheet1!$A:$A))))-1,0)
error fixed... the 6 should not be hard coded |
#5
|
|||
|
|||
Copying a column list from one sheet to another and repeating?
Thanks klswvu, one thing I didn't mention is that the column containing the
list on sheet 1 does have other content above it so the forumla would need to specify which cell in the column the list starts from. Is that possible? "klswvu" wrote: =OFFSET(Sheet1!$A$1,((MOD(COLUMN(),(COUNTA(Sheet1! $A:$A)))=0)*(COUNTA(Sheet1!$A:$A)))+(MOD(COLUMN(), (COUNTA(Sheet1!$A:$A))))-1,0) error fixed... the 6 should not be hard coded |
#6
|
|||
|
|||
Copying a column list from one sheet to another and repeating?
Thanks klswvu, one thing I didn't mention is that the column containing the
list on sheet 1 does have other content above it so the forumla would need to specify which cell in the column the list starts from. Is that possible? Yes... Sheet1!$A$1 is the top value of the range it can be anything ie Sheet1!$A$20 COUNTA(Sheet1!$A:$A) needs to be modified ie COUNTA(Sheet1!$A$20:$A$100) or you can make it a defined dynamic named range. =OFFSET(Sheet1!$A$1,((MOD(COLUMN(),(COUNTA(Sheet1! $A:$A)))=0)*(COUNTA(Sheet1!$A:$A)))+(MOD(COLUMN(), (COUNTA(Sheet1!$A:$A))))-1,0) |
#7
|
|||
|
|||
Copying a column list from one sheet to another and repeating?
I used this formula but the list heading text is still being repeated with
the list contents... =OFFSET('Sheet 1'!$A$2,((MOD(COLUMN(),(COUNTA('Sheet 1'!$A$2:$A$10)))=0)*(COUNTA('Sheet 1'!$A$2:$A$10)))+(MOD(COLUMN(),(COUNTA('Sheet 1'!$A$2:$A$10))))-1,0) "klswvu" wrote: Thanks klswvu, one thing I didn't mention is that the column containing the list on sheet 1 does have other content above it so the forumla would need to specify which cell in the column the list starts from. Is that possible? Yes... Sheet1!$A$1 is the top value of the range it can be anything ie Sheet1!$A$20 COUNTA(Sheet1!$A:$A) needs to be modified ie COUNTA(Sheet1!$A$20:$A$100) or you can make it a defined dynamic named range. =OFFSET(Sheet1!$A$1,((MOD(COLUMN(),(COUNTA(Sheet1! $A:$A)))=0)*(COUNTA(Sheet1!$A:$A)))+(MOD(COLUMN(), (COUNTA(Sheet1!$A:$A))))-1,0) |
#8
|
|||
|
|||
Copying a column list from one sheet to another and repeating?
I used this formula but the list heading text is still being repeated with
the list contents... Remove the -1 at the end if you have a Heading. |
#9
|
|||
|
|||
Copying a column list from one sheet to another and repeating?
=OFFSET('Sheet
1'!$A$2,((MOD(COLUMN(),(COUNTA('Sheet1'!$A$2:$A$10 )))=0)*(COUNTA('Sheet1'!$A$2:$A$10)))+(MOD(COLUMN( ),(COUNTA('Sheet 1'!$A$2:$A$10)))),0) Explanation: OFFSET(reference, rows, columns, [height], [width]) returns the cells x rows and y columns from the reference Reference is an anchor point... top of your product range $A$2 Determine how many rows down from the reference anchor... ((MOD(COLUMN(),(COUNTA('Sheet1'!$A$2:$A$10)))=0)*( COUNTA('Sheet1'!$A$2:$A$10)))+(MOD(COLUMN(),(COUNT A('Sheet 1'!$A$2:$A$10)))) (MOD(COLUMN(),(COUNTA('Sheet1'!$A$2:$A$10)))=0) ... returns the remainder of the column number by the total count of the range and determine if it is zero (returns 0 or 1) *(COUNTA('Sheet1'!$A$2:$A$10)) ... multiple by the total count of the range +(MOD(COLUMN(),(COUNTA('Sheet 1'!$A$2:$A$10))) ... add the count of the range Assume the range has seven values... column 1 would result in (0*1)+1 = 1 so go down one row from the reference anchor column 2 would result in (0*2)+2 = 2 so go down one row from the reference anchor column 3 would result in (0*3)+3 = 3 so go down one row from the reference anchor column 4 would result in (0*4)+4 = 4 so go down one row from the reference anchor column 5 would result in (0*5)+5 = 5 so go down one row from the reference anchor column 6 would result in (0*6)+6 = 6 so go down one row from the reference anchor column 7 would result in (1*7)+0 = 7 so go down one row from the reference anchor column 8 would result in (0*1)+1 = 1 so go down one row from the reference anchor Determine how many columns across from the reference anchor... ,0 ... it is zero |
#10
|
|||
|
|||
Copying a column list from one sheet to another and repeating?
Thanks for that, I used this formula...
=OFFSET(Sheet1!$A$6,((MOD(COLUMN(),(COUNTA(Sheet1! $A$6:$A$10)))=0)*(COUNTA(Sheet1!$A$6:$A$10)))+(MOD (COLUMN(),(COUNTA(Sheet1!$A$6:$A$10)))),0) But got an 'error in value' message. The first item in the list on sheet 1 is at A6 and I entered the formula in cell B5 on sheet 2. "klswvu" wrote: =OFFSET('Sheet 1'!$A$2,((MOD(COLUMN(),(COUNTA('Sheet1'!$A$2:$A$10 )))=0)*(COUNTA('Sheet1'!$A$2:$A$10)))+(MOD(COLUMN( ),(COUNTA('Sheet 1'!$A$2:$A$10)))),0) Explanation: OFFSET(reference, rows, columns, [height], [width]) returns the cells x rows and y columns from the reference Reference is an anchor point... top of your product range $A$2 Determine how many rows down from the reference anchor... ((MOD(COLUMN(),(COUNTA('Sheet1'!$A$2:$A$10)))=0)*( COUNTA('Sheet1'!$A$2:$A$10)))+(MOD(COLUMN(),(COUNT A('Sheet 1'!$A$2:$A$10)))) (MOD(COLUMN(),(COUNTA('Sheet1'!$A$2:$A$10)))=0) ... returns the remainder of the column number by the total count of the range and determine if it is zero (returns 0 or 1) *(COUNTA('Sheet1'!$A$2:$A$10)) ... multiple by the total count of the range +(MOD(COLUMN(),(COUNTA('Sheet 1'!$A$2:$A$10))) ... add the count of the range Assume the range has seven values... column 1 would result in (0*1)+1 = 1 so go down one row from the reference anchor column 2 would result in (0*2)+2 = 2 so go down one row from the reference anchor column 3 would result in (0*3)+3 = 3 so go down one row from the reference anchor column 4 would result in (0*4)+4 = 4 so go down one row from the reference anchor column 5 would result in (0*5)+5 = 5 so go down one row from the reference anchor column 6 would result in (0*6)+6 = 6 so go down one row from the reference anchor column 7 would result in (1*7)+0 = 7 so go down one row from the reference anchor column 8 would result in (0*1)+1 = 1 so go down one row from the reference anchor Determine how many columns across from the reference anchor... ,0 ... it is zero |
|
Thread Tools | |
Display Modes | |
|
|