match row value and column name to return different column value

eagleaye

New Member
Joined
Oct 15, 2013
Messages
24
I'm trying to reformat some data and looking for a formula that can match a value in a row, look up a value in the row, then if the cell value matches the column heading return values from a further two columns.
Here's some sample data that might make my aims clearer, I want to match the cell value under fieldName in worksheet 1 with the column name in worksheet 2 and fill the other related columns with the Source and Date values from worksheet 1.

Worksheet 1


sernumFieldNameValueSourceDate
1con 14.0000bon16/02/2010
2con 21.0000bon16/02/2010
3con 3.0000cen25/11/2010
4con 4.0000cen25/11/2010
5con 5.0000cen25/11/2010
6con 670.7700cen13/01/2011
7con 7Yescen21/03/2011
8con 10.0000cen13/01/2011
9con 9.0000cen30/06/2011
10con 10.0000cen30/06/2011
11con 919/11/2008bon16/02/2010
12con 1221/10/1928bon29/03/2011
13con 230/07/1999bon16/02/2010
14con 3.0000bon11/01/2011
15con 4.0000bon13/05/2010
16con 51.0000bon11/01/2011
17con 61.0000bon13/05/2010
18con 18.0000bon11/01/2011
19con 19.0000bon13/05/2010
20con 20Mcen01/06/2011

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>

Worksheet 2

sernum con 1 con 1 source con 1 date con 2 con 2 source con2 date con 3 con 3 source con 3 date1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Hope this makes sense, any help much appreciated
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi, It's not quite clear what you would like to achieve. Please mock up the result manually, preferably in a real spreadsheet and post (use a file sharing site) that for inspection.
 
Upvote 0
Thanks teylyn, I suspected I was being a little unclear hopefully the sheets below might make more sense.

Essentially I want to match the "sernum" value from worksheet 2 with that in worksheet 1, then look up the worksheet 1 column D value, if it matches the column header in worksheet 2 populate corresponding cells with values from column C,E,F and G in worksheet 2

worksheet 1

ABCDEFG
1sernumRegfieldnamevaluesourcedate
2 11 con 1 red bon 16/2/2010
3 21 con 2 2 bon 16/2/2010
431con 30bon 25/11/2010
541con 40cen25/11/2010
651con 570.7cen13/1/2011
762con 24bon30/6/2011
872con 60egt16/2/2011
982con 1orangehk13/5/2010
1092con 319/11/2009bon11/1/2010
11102con 430/5/1999bon12/6/2011
12112con50.00get12/6/2011
13123con 1bluebon25/4/2011
14133con 25.5bon13/5/2011
15 143 con 3 27/8/2008ken 30/6/2010
etc........................

<tbody>
</tbody>
 
Last edited:
Upvote 0
worksheet 2

ABCDEFGHIJKL
1sernumRegcon 1con 1 sourcecon 1 datecon 2con 2 sourcecon 2 datecon 3con 3 sourcecon 3 dateetc
211redbon16/2/2010
3212bon16/2/2010
7624bon30/6/2011
982orangehk13/5/2010
109219/11/2009bon11/1/2010
13123bluebon25/4/2011
141335.5bon13/5/2011
1514327/8/2008ken30/6/2010
etc........................

<tbody>
</tbody>
 
Upvote 0
Is anyone able to help with this?
I've got so far trying combinations of vloopup, hlookup and index match but end up populating the column rows in worksheet 2 with the same values as I can't work out how to match the sernum columns.
 
Upvote 0

Forum statistics

Threads
1,215,459
Messages
6,124,944
Members
449,198
Latest member
MhammadishaqKhan

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