If value in a cell match any cell of a roll in a diferent sheet then copy a specific value from that same column

esmarques

New Member
Joined
Oct 27, 2020
Messages
34
Office Version
  1. 365
Platform
  1. MacOS
Hello,
I am trying to rearrange the columns from a downloaded survey into a template to be able to upload it to a website.

In the file attached I would like to copy the values in sheet "Data" into the sheet "Template" where the columns match by the question Code?
I have tried 2 different formulas, but none worked...
Could anyone help?

Thank you

"Template" Sheet:

Question CodeB-Q1B-Q2B-Q3B-Q4B-Q4-CommentB-Q5
Question TextFirst NameFavourite ColourManagerAreaPost CodeAge
Responses#SPILL!Mark45-49
BlueJane35-39
WhiteJohn65-69
YellowLeon40-44



Data Sheet:
Question CodeB-Q2B-Q1B-Q5B-Q4B-Q4-CommentB-Q3
Question colourNameAgeAreapost CodeManager
Responses2/2/23Mark45-49UkLeon
BlueJane35-39EULeon
WhiteJohn65-69Non-EUGordon
YellowLeon40-44OtherEmily
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
How about
Fluff.xlsm
ABCDEFG
1Question CodeB-Q2B-Q1B-Q5B-Q4B-Q4-CommentB-Q3
2Question colourNameAgeAreapost CodeManager
3Responses44959Mark45-49UkLeon
4BlueJane35-39EULeon
5WhiteJohn65-69Non-EUGordon
6YellowLeon40-44OtherEmily
Data


Fluff.xlsm
ABCDEFG
1Question CodeB-Q1B-Q2B-Q3B-Q4B-Q4-CommentB-Q5
2Question TextFirst NameFavourite ColourManagerAreaPost CodeAge
3ResponsesMark44959LeonUk045-49
4JaneBlueLeonEU035-39
5JohnWhiteGordonNon-EU065-69
6LeonYellowEmilyOther040-44
7
Sheet4
Cell Formulas
RangeFormula
B3:G6B3=CHOOSECOLS(Data!B3:G6,XMATCH(B1:G1,Data!B1:G1))
Dynamic array formulas.
 
Upvote 0
Solution
How about
Fluff.xlsm
ABCDEFG
1Question CodeB-Q2B-Q1B-Q5B-Q4B-Q4-CommentB-Q3
2Question colourNameAgeAreapost CodeManager
3Responses44959Mark45-49UkLeon
4BlueJane35-39EULeon
5WhiteJohn65-69Non-EUGordon
6YellowLeon40-44OtherEmily
Data


Fluff.xlsm
ABCDEFG
1Question CodeB-Q1B-Q2B-Q3B-Q4B-Q4-CommentB-Q5
2Question TextFirst NameFavourite ColourManagerAreaPost CodeAge
3ResponsesMark44959LeonUk045-49
4JaneBlueLeonEU035-39
5JohnWhiteGordonNon-EU065-69
6LeonYellowEmilyOther040-44
7
Sheet4
Cell Formulas
RangeFormula
B3:G6B3=CHOOSECOLS(Data!B3:G6,XMATCH(B1:G1,Data!B1:G1))
Dynamic array formulas.
Hello,
Thank you for this. How would I then do for the other cells like B4 and C3 ?
Does it also matter if the range is different? Could I put for example range B3:BD500.
My plan is to make a template so when people copy the information in the "Data" Sheet, it will be calculated/rearranged in the "Template" sheet.

Thank you
 
Last edited:
Upvote 0
What happened why you tried the formula?
 
Upvote 0
Glad it's sorted & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,183
Members
452,615
Latest member
bogeys2birdies

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