Copy column data based on header value

Dairy

New Member
Joined
Jul 26, 2005
Messages
24
My first try at adding html example (hope it works)

I've spent the last hour trying to come up with a solution but nothings working. I have included the simplified example below. I will have up to 30 columns of data on the final version.

Excel Workbook
ABCD
1pdk10/10/201024/10/20105/11/2010
21142310566544
32167829432134
43380948549098
54328792865176
65902482658537
76649738519871
87140843255432
98549045433423
109324743345443
1110431797634533
Sheet1


On sheet 1 have my data. On sheet 2 B2:B11 should automatically update assuming the value in B1 matches sheet1 B1:D1

Excel Workbook
AB
1pdk5/11/2010
216544
322134
439098
545176
658537
769871
875432
983423
1095443
11104533
Sheet2


So changing the date should return

Excel Workbook
AB
1pdk24/10/2010
211056
322943
434854
549286
658265
763851
874325
984543
1094334
11109763
Sheet2


I'm sure the answer has something to do with Vlookup.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Dairy,


Excel Workbook
ABCD
1pdk10/10/201024/10/20105/11/2010
21142310566544
32167829432134
43380948549098
54328792865176
65902482658537
76649738519871
87140843255432
98549045433423
109324743345443
1110431797634533
12
Sheet1





Excel Workbook
ABCD
1pdk5/11/201024/10/201010/10/2010
21654410561423
32213429431678
43909848543809
54517692863287
65853782659024
76987138516497
87543243251408
98342345435490
109544343343247
1110453397634317
12
Sheet2




The formula in cell B2, copied to the range B2:D11

=VLOOKUP($A2,Sheet1!$A$2:$D$11,MATCH(B$1,Sheet1!$A$1:$D$1,0),0)
 
Upvote 0
Dairy,


Excel Workbook
ABCD
1pdk10/10/201024/10/20105/11/2010
21142310566544
32167829432134
43380948549098
54328792865176
65902482658537
76649738519871
87140843255432
98549045433423
109324743345443
1110431797634533
12
Sheet1





Excel Workbook
AB
1pdk5/11/2010
216544
322134
439098
545176
658537
769871
875432
983423
1095443
11104533
12
Sheet2





Excel Workbook
AB
1pdk24/10/2010
211056
322943
434854
549286
658265
763851
874325
984543
1094334
11109763
12
Sheet2




The formula in cell B2, copied to the range B2:B11

=VLOOKUP($A2,Sheet1!$A$2:$D$11,MATCH(B$1,Sheet1!$A$1:$D$1,0),0)
 
Upvote 0
Dairy,


Or, your could use INDEX MATCH.


Excel Workbook
AB
1pdk5/11/2010
216544
322134
439098
545176
658537
769871
875432
983423
1095443
11104533
12
Sheet2




The formula in cell B2 copied down:

=INDEX(Sheet1!$B$2:$D$11,MATCH($A2,Sheet1!$A$2:$A$11,0),MATCH($B$1,Sheet1!$B$1:$D$1,0))
 
Upvote 0
Forgot to thank you for your reply 'Hiker95'.

I ended up using:
=INDEX(Sheet1!$B$2:$D$11,MATCH($A2,Sheet1!$A$2:$A$11,0),MATCH($B$1,Sheet1!$B$1:$D$1,0))

Works like a charm!

Thanks again for your help..
 
Upvote 0
Dairy,

You are very welcome.

Glad I could help.

Thanks for the feedback.

Come back anytime.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,277
Members
452,902
Latest member
Knuddeluff

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