Ask Your Question
0

paste numbers into 4 columns

asked 2017-11-09 19:05:51 +0100

joeh6966 gravatar image

updated 2017-11-09 22:15:20 +0100

I want to take a column of 120 or so numbers from a spreadsheet and enter them in another spreadsheet in 4 columns. So, the first 4 numbers would be side by side in row 1 and the second 4 numbers would be in row 2. I have a workaround that is doable but labor intensive. I can highlight the first and 5th and 9th etc. numbers until I get to 117, and then Copy or Cut and then Paste into the new spreadsheet. And repeat 3 more times. I think there should be someone out there who has already figured this out. If not, maybe I'll need to learn how to write a Macro.

edit retag flag offensive close merge delete

Comments

What was wrong with the formula @Jim K posted? It works flawlessly for the pupose. You won't find a ready-made tool for the very specific proceeding.

Lupp gravatar imageLupp ( 2017-11-09 23:11:54 +0100 )edit

I didn't see it yet. Just now I hit the refresh button in my URL field and got these messages.

joeh6966 gravatar imagejoeh6966 ( 2017-11-09 23:19:02 +0100 )edit

It does work flawlessly! It is the answer to my needs. I couldn't have ever figured out how to write that equation. Awesome!

joeh6966 gravatar imagejoeh6966 ( 2017-11-09 23:37:05 +0100 )edit

I didn't see until 10 minutes ago. It does work flawlessly. Thanks @Jim K. I do not see where I can thank him except in these Comment boxes.

joeh6966 gravatar imagejoeh6966 ( 2017-11-09 23:46:25 +0100 )edit

You're welcome!

The way to thank someone is to mark the answer as correct, which you have done, and consider upvoting the answer (maybe you did this too; it's anonymous so I'm not sure). Optionally add a comment, which you have also done. It would have been more proper to comment on the answer, rather than the question, but that's a minor point.

Jim K gravatar imageJim K ( 2017-11-10 20:12:05 +0100 )edit

I looked there but thought that it would be commenting on the comment about commas and semi-colons.

joeh6966 gravatar imagejoeh6966 ( 2017-11-17 15:59:48 +0100 )edit

2 Answers

Sort by » oldest newest most voted
2

answered 2017-11-09 20:42:01 +0100

Jim K gravatar image

updated 2017-11-10 19:50:07 +0100

Enter the following formula in cell B1.

=INDIRECT(ADDRESS((ROW()-1)*4+COLUMN()-1;1))

Then drag to fill over to E1, then down as far as needed.

result

Finally, cut from columns B through E and paste special as values into the new spreadsheet.

edit flag offensive delete link more

Comments

A majority of locales cannot use the comma as the parameter delimiter because it conflicts with the decimal separator. The semicolon is still accepted globally by all locales. For some time now it got replaced for the display by a comma in locales using the point as the decimal separator. An ingenious idea to mess up international cooperation in forums.
But you will not be blamed if you continue to post formulas with the semicolon.

Lupp gravatar imageLupp ( 2017-11-09 23:14:23 +0100 )edit

@Lupp: Oops, thanks; I knew that but forgot to change it before posting.

Jim K gravatar imageJim K ( 2017-11-10 19:49:24 +0100 )edit

Thanks! BTW, shouldn't the last word in Lupp's comment be "comma"?

joeh6966 gravatar imagejoeh6966 ( 2017-11-17 16:00:40 +0100 )edit
1

answered 2017-11-10 00:57:44 +0100

Lupp gravatar image

updated 2017-11-10 19:54:58 +0100

There is also a way with less and simpler fomulas: Paste the copied column 4 times in adjacent columns, the first one starting at row five, the next one to the right one row higher and so on. Above the first element in the last column you have one empty cell now. Right of the first element in the last row column enter the formula =(MOD(ROW()-1;1)=0) {acting on the comment below; correction of the typo:} =(MOD(ROW()-1;4)=0) and fill it down for all the non-empty rows. Now select this column completely and choose the 'Autofliter' from 'Data'. From the dropdown of the filter select TRUE. If you now copy what not is filtered out, you can paste it elsewhere to get the wanted result. Hmmm... Lot of handiwork... (Just for completeness, kind of.)

edit flag offensive delete link more

Comments

I got as far as the formula into the cell right of the last row. When I filled it down, the whole column said "TRUE". And then nothing happened using Autofilter.

joeh6966 gravatar imagejoeh6966 ( 2017-11-10 16:37:39 +0100 )edit

Sorry! There was a typo. The formula should say TRUE in every fourth row. starting with row 5.. ROW()-1 returns 4, 5, 6, 7, 8 ,9 and so on then, row by row. It's one of the rows where a valid group of 4 consecutive elements is shown exactly if the number returned is divisible by 4 without a remainder. The MOD function is made for this: MOD(SomeInt; SomeIntDivisor) returns the remainder you get if you divide SomeInt by SomeIntDivisor. Mod(N;1)=0 is always TRUE, of course.

Lupp gravatar imageLupp ( 2017-11-10 18:28:22 +0100 )edit

I tried it again with your changes, and it does work. It's very interesting how different approaches can yield the same result. Thanks.

joeh6966 gravatar imagejoeh6966 ( 2017-11-17 19:17:26 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-11-09 19:05:51 +0100

Seen: 205 times

Last updated: Nov 10 '17