MATCHING COLUMNS TO ROWS in VB

davidhall80

Well-known Member
Joined
Jul 8, 2006
Messages
663
I have data in Column A which matches data in Row 1 starting in column C.



In column B, I want to get the value of the matching cell in column A and row one. Column B is blank, but I would like to get column B to equal the following.
example


........A..........B...........C............D.............E..............F.................G
1............................Zone1......Zone5.......Zone3......Zone8........Zone9

2.Zone8........500......000........56..............72...........500..............78

3.Zone5........56..........76.......56...............43...........865.............954

4.Zone9........94...........72........90...............543.........657............94

5.Zone 3.......56............054......243............56.............905..........809

6.Zone1........000........000.........897..........908............329...........419


B2 should equal the cell that joins the matching column and row. Does this question make sense
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,884
Hi davidhall80

With the layout of the example, in B2

Code:
=INDEX($A$1:$G$6,MATCH(A2,$A:$A,0),MATCH(A2,$1:$1,0))
Copy down

Hope this helps
PGC
Book1
ABCDEFGHI
1Zone1Zone5Zone3Zone8Zone9
2Zone85000567250078
3Zone556765643865954
4Zone994729054365794
5Zone3565424356905809
6Zone100897908329419
7
8
Sheet1
 

Forum statistics

Threads
1,136,348
Messages
5,675,238
Members
419,555
Latest member
Paddington

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
Top