Transposing data accross a fixed number of columns

LSQuinn

New Member
Joined
Aug 30, 2023
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm trying to achieve the following -

Each day I import an updated spreadsheet with the following colums

LousQuinn_0-1692611996818.png


The data will grow each time it's imported but the headings will always stay the same.

I need to transpose the data accross the colums like

LousQuinn_1-1692612154251.png


The first name will be in column B (column A will be used for ID's which I create)

The headings created should run until 30 so start at Name and end at Name 30

After the 30th name and email has been transposed the 31st will drop below the first Name column again as per image, transpose to the 30th again, and keep repeating until all the data is transposed

LousQuinn_2-1692612497996.png


I've used the following function before to do something similar and wondered if it could be modified work for this scenario? (the emails visable are my own test emails)

=LET( Arr, TRANSPOSE(A2:C5), rws, ROWS(Arr), seq, SEQUENCE(,rws * COLUMNS(Arr),0), sqR, 1+MOD(seq, rws), sqC, 1+QUOTIENT(seq, rws), CHOOSE({1;2}, INDEX({"Name ","Email ","Phone "}, sqR) & sqC, INDEX(Arr, sqR, sqC)) )

Many thanks,

Lou
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi & welcome to MrExcel.
How about
Excel Formula:
=VSTACK(TOROW(IF(SEQUENCE(30),A1:E1)),WRAPROWS(TOCOL(A2:E111),150,""))
 
Upvote 0
Thanks very much - where would you input the formula please?
 
Upvote 0
Any where you like. :)
If you want it on a different sheet then just add the sheet name to the ranges
 
Upvote 0
Hi, Thanks again! i'm being stupid sorry.

Ideally, the data i'd import would be in sheet 1 then in sheet 2, i'd use your formula, Presuming the formula will then stay in place when downloaded

As I said the first Name would appear in column B and run for 30 columns (as your formula is doing now thanks) and then start again under column Name, and so on.

The only other part I didn't clarify is i'd like the headings to show as

Name Email Afford Pets Beds Name 1 Email 1 Afford 1 Pets 1 Beds 1 Name 2 Email 2 Afford 2 Pets 2 Beds 2 untl 30

Thanks again for your help (and patience!)

Lou
 
Upvote 0
Ok, how about
Excel Formula:
=VSTACK(TOROW(Sheet1!A1:E1&" "&SEQUENCE(30)),WRAPROWS(TOCOL(Sheet1!A2:E35),150,""))
 
Upvote 0
Hi! thanks very much, this is just what I need. As a welshman might even have to wish you good luck next month!!

thanks again,
Lou
 
Upvote 0
Glad to help & thanks for the feedback.

I think we'll both need a lot of luck. :(
 
Upvote 0
Hi,

I've just tried using this formulav- =VSTACK(TOROW(Sheet1!A1:E1&" "&SEQUENCE(30)),WRAPROWS(TOCOL(Sheet1!A2:E35),150,""))

with differentt headings and for some reason it's stopped starting again after 30 and continues for another 10 turns of #N/A until then starting again under Company 1 as expected. I've changed the &SEQUENCE(30)) to &SEQUENCE(40)) to test and it's still adding the 10 turns of #N/A after. Is there some obvious i'm doing to make this happen? many thanks, Lou
1695119904199.png
 
Upvote 0
Not sure what is going on there, as col CM should have the value from A1 & 19, so no idea why it showing 30
 
Upvote 0

Forum statistics

Threads
1,215,107
Messages
6,123,126
Members
449,097
Latest member
mlckr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top