ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Formula to copy every other cell value from a single row to a single column, (https://www.excelbanter.com/excel-worksheet-functions/454101-formula-copy-every-other-cell-value-single-row-single-column.html)

Andy McNicol

Formula to copy every other cell value from a single row to a single column,
 
Hi All,

I have some data in a spread sheet which is on a row, with only one entry every 4 columns.

Now I want to transpose this to a single column but don't want any of the empty cells. Now have tried using "INDIRECT" and this will indeed allow me to select every 4 rows but only horizontally i.e. across the columns. Now I am pretty sure I have to use a combination of formulas to achieve this but which ones I am not to sure as well as how so any help would be greatly appreciated.

Example below.

How it looks...

A B C D E F G H I J K L M..........
1 5 9 7

Using Indirect I get...

A B C D E F G..........
1 5 9 7

Which works as it only gives me the cells I need, however want it as follows;

A
1
5
9
7

Note I only shown 4 entries, but there is many more.

Is there another way of doing this, which I am just not seeing.

Thanks Again.

Andy


Claus Busch

Formula to copy every other cell value from a single row to a single column,
 
Hi Andy,

Am Wed, 6 Jun 2018 01:55:55 -0700 (PDT) schrieb Andy McNicol:

How it looks...

A B C D E F G H I J K L M..........
1 5 9 7

Using Indirect I get...

A B C D E F G..........
1 5 9 7

Which works as it only gives me the cells I need, however want it as follows;

A
1
5
9
7


in A1:
=INDEX(Sheet1!$1:$1,,ROW()*2-1)
and copy down.


Regards
Claus B.
--
Windows10
Office 2016

Andy McNicol

Formula to copy every other cell value from a single row to asingle column,
 
On Wednesday, 6 June 2018 11:31:32 UTC+1, Claus Busch wrote:
Hi Andy,

Am Wed, 6 Jun 2018 01:55:55 -0700 (PDT) schrieb Andy McNicol:

How it looks...

A B C D E F G H I J K L M..........
1 5 9 7

Using Indirect I get...

A B C D E F G..........
1 5 9 7

Which works as it only gives me the cells I need, however want it as follows;

A
1
5
9
7


in A1:
=INDEX(Sheet1!$1:$1,,ROW()*2-1)
and copy down.


Regards
Claus B.
--
Windows10
Office 2016


Thanks Claus,

Your help is much appreciated, now have it all in the same row which is good, however not quite there as getting the following results;

A
0
21
0
23
0
43
0
34

Also should have probably been clearer but want to retain the original data as well so no overwrite in A1. So for testing purposes added the formula into Cell A4, but for some reason it ignores the first 2 values in the row and still returns a 0 between the values.

Sorry to be a pain

Andy

Claus Busch

Formula to copy every other cell value from a single row to a single column,
 
Hi Andy,

Am Wed, 6 Jun 2018 03:51:06 -0700 (PDT) schrieb Andy McNicol:

Your help is much appreciated, now have it all in the same row which is good, however not quite there as getting the following results;

A
0
21
0
23
0
43
0
34

Also should have probably been clearer but want to retain the original data as well so no overwrite in A1. So for testing purposes added the formula into Cell A4, but for some reason it ignores the first 2 values in the row and still returns a 0 between the values.


I thought you would have the results in another sheet.
You have data in every other cell. So you have to multiply ROW() with 2.
When you start in row 4 you must change the formula to:
=INDEX($1:$1,,ROW()*2-7)


Regards
Claus B.
--
Windows10
Office 2016

Andy McNicol

Formula to copy every other cell value from a single row to asingle column,
 
On Wednesday, 6 June 2018 12:05:11 UTC+1, Claus Busch wrote:
Hi Andy,

Am Wed, 6 Jun 2018 03:51:06 -0700 (PDT) schrieb Andy McNicol:

Your help is much appreciated, now have it all in the same row which is good, however not quite there as getting the following results;

A
0
21
0
23
0
43
0
34

Also should have probably been clearer but want to retain the original data as well so no overwrite in A1. So for testing purposes added the formula into Cell A4, but for some reason it ignores the first 2 values in the row and still returns a 0 between the values.


I thought you would have the results in another sheet.
You have data in every other cell. So you have to multiply ROW() with 2.
When you start in row 4 you must change the formula to:
=INDEX($1:$1,,ROW()*2-7)


Regards
Claus B.
--
Windows10
Office 2016


Hi Claus,




Thanks again,




And apologies you are right ultimately it will end up on a different sheet, so probably should have done that, but wanted to view the results on the same sheet for test purposes so my fault.




Anyway our help is greatly appreciated as was pulling my hair out as I know I have done this before, but for the life of me cannot remember what and why I used it. So many spread sheets I have been through over the years.




Just one thing now and then I am sorted, I am still; getting a 0 between each of numbers./ Thus how do I get rid of this so I only get the cells with the actual values in it. Note that on the original sheet there will be an entry every 5th cell on the row.




Regards,




Andy

Claus Busch

Formula to copy every other cell value from a single row to a single column,
 
Hi Andy,

Am Wed, 6 Jun 2018 04:30:48 -0700 (PDT) schrieb Andy McNicol:

Just one thing now and then I am sorted, I am still; getting a 0 between each of numbers./ Thus how do I get rid of this so I only get the cells with the actual values in it. Note that on the original sheet there will be an entry every 5th cell on the row.


where are your values? In every third cell? Then you must multiply with
3.
Your table in your question was in a mess and I couldn't see in which
columns your values are.


Regards
Claus B.
--
Windows10
Office 2016

Claus Busch

Formula to copy every other cell value from a single row to a single column,
 
Hi Andy,

Am Wed, 6 Jun 2018 04:30:48 -0700 (PDT) schrieb Andy McNicol:

Just one thing now and then I am sorted, I am still; getting a 0 between each of numbers./ Thus how do I get rid of this so I only get the cells with the actual values in it. Note that on the original sheet there will be an entry every 5th cell on the row.


have a look:
https://1drv.ms/x/s!AqMiGBK2qniTgc5oNtEN1ZcSxHN4NQ


Regards
Claus B.
--
Windows10
Office 2016

Andy McNicol

Formula to copy every other cell value from a single row to asingle column,
 
On Wednesday, 6 June 2018 12:51:06 UTC+1, Claus Busch wrote:
Hi Andy,

Am Wed, 6 Jun 2018 04:30:48 -0700 (PDT) schrieb Andy McNicol:

Just one thing now and then I am sorted, I am still; getting a 0 between each of numbers./ Thus how do I get rid of this so I only get the cells with the actual values in it. Note that on the original sheet there will be an entry every 5th cell on the row.


have a look:
https://1drv.ms/x/s!AqMiGBK2qniTgc5oNtEN1ZcSxHN4NQ


Regards
Claus B.
--
Windows10
Office 2016


Claus,

You are a superstar, thank you very much all is good now. That link explained it all and let me know what I had to do visually.

Thanks again,

Hopefully I can return the favour in the future.

Andy


All times are GMT +1. The time now is 05:28 PM.

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