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
<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
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
sernum | FieldName | Value | Source | Date |
1 | con 1 | 4.0000 | bon | 16/02/2010 |
2 | con 2 | 1.0000 | bon | 16/02/2010 |
3 | con 3 | .0000 | cen | 25/11/2010 |
4 | con 4 | .0000 | cen | 25/11/2010 |
5 | con 5 | .0000 | cen | 25/11/2010 |
6 | con 6 | 70.7700 | cen | 13/01/2011 |
7 | con 7 | Yes | cen | 21/03/2011 |
8 | con 10 | .0000 | cen | 13/01/2011 |
9 | con 9 | .0000 | cen | 30/06/2011 |
10 | con 10 | .0000 | cen | 30/06/2011 |
11 | con 9 | 19/11/2008 | bon | 16/02/2010 |
12 | con 12 | 21/10/1928 | bon | 29/03/2011 |
13 | con 2 | 30/07/1999 | bon | 16/02/2010 |
14 | con 3 | .0000 | bon | 11/01/2011 |
15 | con 4 | .0000 | bon | 13/05/2010 |
16 | con 5 | 1.0000 | bon | 11/01/2011 |
17 | con 6 | 1.0000 | bon | 13/05/2010 |
18 | con 18 | .0000 | bon | 11/01/2011 |
19 | con 19 | .0000 | bon | 13/05/2010 |
20 | con 20 | M | cen | 01/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