Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default copy data while skipping a predetermined number of cells

I want to copy data from a row (or column) to a new row (or column) but skip
a fixed number of cells between each data point, e.g.
A B C D E F G H I J
Row 1, 10 12 14 10 11 ( five data points in five cells) to be copied to

Row 2, 10 12 14 10 11

In this case data would skip one cell but my need is often for 2,3 or even
four cells.
Any help would be much appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 793
Default copy data while skipping a predetermined number of cells

For copying values in Row 1 to Row 2 and skipping every other value try in A2
and copy across to B2, C2...
=INDIRECT("R1C"&(COLUMN()-1)*2+1,0)

You can change 2 to 3 or 4 to get every third or fourth value.

For columns use for copying values in Col 1 in B1 and copy down
=INDIRECT("R"&(ROW()-1)*2+1&"C1",0)

"hans L" wrote:

I want to copy data from a row (or column) to a new row (or column) but skip
a fixed number of cells between each data point, e.g.
A B C D E F G H I J
Row 1, 10 12 14 10 11 ( five data points in five cells) to be copied to

Row 2, 10 12 14 10 11

In this case data would skip one cell but my need is often for 2,3 or even
four cells.
Any help would be much appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default copy data while skipping a predetermined number of cells

Thanks for your response. I've tried your suggestion but that does not work.
With the values 10,12,14,10,11 in cells A1,B1,C1,D1,and E1 applying your
INDIRECT function returns 10,14,11,0,0 in cells A2,B2,C2,D2,E2. The result I
am looking for is 10 in A2, 12 in C2, 14 in E2, 10 in G2, etc. The function
needs to leave one (or two) blank cell(s) between the returned values.
I have also tried to apply the function to values in columns but have not
had any results with that either.
Any other suggestions?
Thanks in advance.


"Sheeloo" wrote:

For copying values in Row 1 to Row 2 and skipping every other value try in A2
and copy across to B2, C2...
=INDIRECT("R1C"&(COLUMN()-1)*2+1,0)

You can change 2 to 3 or 4 to get every third or fourth value.

For columns use for copying values in Col 1 in B1 and copy down
=INDIRECT("R"&(ROW()-1)*2+1&"C1",0)

"hans L" wrote:

I want to copy data from a row (or column) to a new row (or column) but skip
a fixed number of cells between each data point, e.g.
A B C D E F G H I J
Row 1, 10 12 14 10 11 ( five data points in five cells) to be copied to

Row 2, 10 12 14 10 11

In this case data would skip one cell but my need is often for 2,3 or even
four cells.
Any help would be much appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 793
Default copy data while skipping a predetermined number of cells

I misunderstood your requirement.

Try
=IF(MOD(COLUMN(),2),INDIRECT("R1C"&(COLUMN()-1)/2+1,0),"")
in A2 and copy across to B2, C2...



"hans L" wrote:

Thanks for your response. I've tried your suggestion but that does not work.
With the values 10,12,14,10,11 in cells A1,B1,C1,D1,and E1 applying your
INDIRECT function returns 10,14,11,0,0 in cells A2,B2,C2,D2,E2. The result I
am looking for is 10 in A2, 12 in C2, 14 in E2, 10 in G2, etc. The function
needs to leave one (or two) blank cell(s) between the returned values.
I have also tried to apply the function to values in columns but have not
had any results with that either.
Any other suggestions?
Thanks in advance.


"Sheeloo" wrote:

For copying values in Row 1 to Row 2 and skipping every other value try in A2
and copy across to B2, C2...
=INDIRECT("R1C"&(COLUMN()-1)*2+1,0)

You can change 2 to 3 or 4 to get every third or fourth value.

For columns use for copying values in Col 1 in B1 and copy down
=INDIRECT("R"&(ROW()-1)*2+1&"C1",0)

"hans L" wrote:

I want to copy data from a row (or column) to a new row (or column) but skip
a fixed number of cells between each data point, e.g.
A B C D E F G H I J
Row 1, 10 12 14 10 11 ( five data points in five cells) to be copied to

Row 2, 10 12 14 10 11

In this case data would skip one cell but my need is often for 2,3 or even
four cells.
Any help would be much appreciated.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default copy data while skipping a predetermined number of cells

Magic! Works like a charm. I also tried to apply the function to skip two
blank cells between values and although the values appear in the intended
cells there are adjacent cells that show #REF! I could just delete that but
there's apparently something wrong with the way I modified the function to
=IF(MOD(COULUMN(),3),INDIRECT("R1C"&(COULUMN()-1/3+1,0),"").

And what would the formula look like when the data is in coulumns rather
than rows?
Thanks very much.

"Sheeloo" wrote:

I misunderstood your requirement.

Try
=IF(MOD(COLUMN(),2),INDIRECT("R1C"&(COLUMN()-1)/2+1,0),"")
in A2 and copy across to B2, C2...



"hans L" wrote:

Thanks for your response. I've tried your suggestion but that does not work.
With the values 10,12,14,10,11 in cells A1,B1,C1,D1,and E1 applying your
INDIRECT function returns 10,14,11,0,0 in cells A2,B2,C2,D2,E2. The result I
am looking for is 10 in A2, 12 in C2, 14 in E2, 10 in G2, etc. The function
needs to leave one (or two) blank cell(s) between the returned values.
I have also tried to apply the function to values in columns but have not
had any results with that either.
Any other suggestions?
Thanks in advance.


"Sheeloo" wrote:

For copying values in Row 1 to Row 2 and skipping every other value try in A2
and copy across to B2, C2...
=INDIRECT("R1C"&(COLUMN()-1)*2+1,0)

You can change 2 to 3 or 4 to get every third or fourth value.

For columns use for copying values in Col 1 in B1 and copy down
=INDIRECT("R"&(ROW()-1)*2+1&"C1",0)

"hans L" wrote:

I want to copy data from a row (or column) to a new row (or column) but skip
a fixed number of cells between each data point, e.g.
A B C D E F G H I J
Row 1, 10 12 14 10 11 ( five data points in five cells) to be copied to

Row 2, 10 12 14 10 11

In this case data would skip one cell but my need is often for 2,3 or even
four cells.
Any help would be much appreciated.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 793
Default copy data while skipping a predetermined number of cells

You were close. Try
=IF(MOD(COLUMN(),3)=1,INDIRECT("R1C"&(COLUMN()-1)/3+1,0),"")

For skipping one cell, =1 clause is not required since MOD gives either 1 or
0. For two or more MOD returns 0, 1, 2, ... so you need the clause.

For columns try
=IF(MOD(ROW(),3)=1,INDIRECT("R"&(ROW()-1)/3+1&"C1",0),"")

essentially you are building the address of the cell you want in R1C1 form
["R"&(ROW()-1)/3+1&"C1"] and then wrapping it in INDIRECT to get the value in
that cell. You use the else path of IF to skip the cells.

Pl. mark 'YES' if you got what you were looking for.



"hans L" wrote:

Magic! Works like a charm. I also tried to apply the function to skip two
blank cells between values and although the values appear in the intended
cells there are adjacent cells that show #REF! I could just delete that but
there's apparently something wrong with the way I modified the function to
=IF(MOD(COULUMN(),3),INDIRECT("R1C"&(COULUMN()-1/3+1,0),"").

And what would the formula look like when the data is in coulumns rather
than rows?
Thanks very much.

"Sheeloo" wrote:

I misunderstood your requirement.

Try
=IF(MOD(COLUMN(),2),INDIRECT("R1C"&(COLUMN()-1)/2+1,0),"")
in A2 and copy across to B2, C2...



"hans L" wrote:

Thanks for your response. I've tried your suggestion but that does not work.
With the values 10,12,14,10,11 in cells A1,B1,C1,D1,and E1 applying your
INDIRECT function returns 10,14,11,0,0 in cells A2,B2,C2,D2,E2. The result I
am looking for is 10 in A2, 12 in C2, 14 in E2, 10 in G2, etc. The function
needs to leave one (or two) blank cell(s) between the returned values.
I have also tried to apply the function to values in columns but have not
had any results with that either.
Any other suggestions?
Thanks in advance.


"Sheeloo" wrote:

For copying values in Row 1 to Row 2 and skipping every other value try in A2
and copy across to B2, C2...
=INDIRECT("R1C"&(COLUMN()-1)*2+1,0)

You can change 2 to 3 or 4 to get every third or fourth value.

For columns use for copying values in Col 1 in B1 and copy down
=INDIRECT("R"&(ROW()-1)*2+1&"C1",0)

"hans L" wrote:

I want to copy data from a row (or column) to a new row (or column) but skip
a fixed number of cells between each data point, e.g.
A B C D E F G H I J
Row 1, 10 12 14 10 11 ( five data points in five cells) to be copied to

Row 2, 10 12 14 10 11

In this case data would skip one cell but my need is often for 2,3 or even
four cells.
Any help would be much appreciated.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Skipping bad data in cells nicmoo Excel Discussion (Misc queries) 5 March 3rd 09 04:02 PM
Automatically skipping cells when pasting data Frustrated Excel Discussion (Misc queries) 1 September 9th 08 11:55 PM
Macro - Copy and Paste repeatedly skipping cells [email protected] Excel Discussion (Misc queries) 5 January 6th 07 11:22 PM
Can I paste data skipping the hidden cells ? tclark67 Excel Discussion (Misc queries) 3 August 22nd 05 07:04 PM
Skipping cells while reorganizing data vertblancrouge Excel Discussion (Misc queries) 0 April 25th 05 07:26 PM


All times are GMT +1. The time now is 07:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"