extract cell data based on column header

bptaw

Board Regular
Joined
Feb 27, 2017
Messages
69
Office Version
  1. 2016
Platform
  1. Windows
I have a table of data with column headings. I want to extract cell data in row 10 from a specific column to use in a formula. I want to reference column 31/12/2021 and select cell L18.

Thomson share assets.xlsm
KLMNOP
131-Jan-2231-Dec-2130-Nov-2131-Oct-2130-Sep-2131-Aug-21
2346.00354.50342.00331.00309.00319.00
3624.80892.80908.00863.20777.00854.00
4495.00518.00528.00496.50529.00557.00
5664.00590.00560.00708.00685.00759.00
6185.00180.00175.00169.50174.00154.50
713.3913.9214.3413.9513.6714.17
84,696.505,286.505,178.005,105.004,858.005,119.00
910,935.0010,273.0010,110.5010,186.0010,067.5010,968.50
1049,200.0050,200.0049,850.0049,300.0048,750.0049,400.00
113,787.503,945.503,859.003,912.003,973.004,046.00
12346.00354.50342.00331.00309.00319.00
134,696.505,286.505,178.005,105.004,858.005,119.00
1449,200.0050,200.0049,850.0049,300.0048,750.0049,400.00
15
16
17
18285,011.12298,376.42292,533.22287,397.98278,099.87284,456.23
19
2036,511.3449,876.6444,033.4438,898.2029,600.0935,956.45
Summary
Cell Formulas
RangeFormula
K18:P18K18=IF(K2="","",(SUMPRODUCT(K2:K6,$B$2:$B$6)+SUMPRODUCT(K8:K14,$B$8:$B$14))/100+K7*$B$7)
K20:P20K20=IF(K18="","",K18-$X$18)
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Your question is not clear.
Does " extract cell data in row 10" mean L10 value = 50200? what to be extracted?
And what is your expected result?
 
Upvote 0
Your question is not clear.
Does " extract cell data in row 10" mean L10 value = 50200? what to be extracted?
And what is your expected result?
Yes, I want to use the value in a specified cell referenced by the column header.
 
Upvote 0
What I could see is row 18 and row 20 with quite perfect formula.
What exactly do you need? type it manually in worksheet.
 
Upvote 0
What I could see is row 18 and row 20 with quite perfect formula.
What exactly do you need? type it manually in worksheet.
I actually want to use the data in row 18. My formula would include the number in that cell in a simple division with another cell.
 
Upvote 0
Your question is still not clear.
Can you please talk us through exactly what you are trying to do?
 
Upvote 0
Apologies for the lack of clarity. Here is a more complete portion of the spreadsheet. What I am after is a formula for the cells E22 and F22 which can automaticaly pickup the value under a header which is 12 months previous to the current month. This changes of course when I add a new column for each new month. It's of course not misison critical, but I just want to expand my understanding of excel possibilities. I hope this is clearer.

Thomson share assets.xlsm
DEFGHIJKLMN
126 Feb 2022Current valuePrevious valueChangeChange since 1 Jan 202128-Feb-2231-Jan-2231-Dec-2130-Nov-2131-Oct-21
2322.0042,784.1444,644.32-4.2%4.5% 346.00354.50342.00331.00
3715.800.000.00 -36.6% 624.80892.80908.00863.20
4482.000.000.00 -7.1% 495.00518.00528.00496.50
5504.000.000.00 -20.6% 664.00590.00560.00708.00
6172.0022,588.7622,326.101.2%63.8% 185.00180.00175.00169.50
713.180.000.00 -10.8% 13.3913.9214.3413.95
84,427.0072,292.9173,060.42-1.1%8.9% 4,696.505,286.505,178.005,105.00
911,908.5011,551.2511,084.684.2%4.0% 10,935.0010,273.0010,110.5010,186.00
1048,700.0087,660.0087,840.00-0.2%7.4% 49,200.0050,200.0049,850.0049,300.00
113,634.000.000.00 -17.3% 3,787.503,945.503,859.003,912.00
12322.0016,100.0016,800.00-4.2%4.5% 346.00354.50342.00331.00
134,427.0011,067.5011,185.00-1.1%8.9% 4,696.505,286.505,178.005,105.00
1448,700.009,740.009,760.00-0.2%7.4% 49,200.0050,200.0049,850.0049,300.00
15 
16ISA236,877.06238,955.52
17Trading36,907.5037,745.00
18Total portfolio value273,784.56276,700.52 285,011.12298,376.42292,533.22287,397.98
19
20This month-11,226.56-4.1% 36,511.3449,876.6444,033.4438,898.20
21Year to date-24,591.86-8.2% -4.5%2.0%1.8%3.3%
2212 months26,256.2110.6% 14.7%20.1%17.7%15.7%
Summary
Cell Formulas
RangeFormula
F8:F14,F2:F6F2=VLOOKUP(A2,'Share Data'!$B$20:$J$30,9,FALSE)*B2/100
G2:G14G2=IF(ISERROR((E2-F2)/F2),"",(E2-F2)/F2)
H2:H14H2=(D2-X2)/X2
F7F7=VLOOKUP(A7,'Share Data'!$B$20:$J$30,9,FALSE)*B7
D1D1=TODAY()
D2:D14D2=VLOOKUP(A2,'Share Data'!$B$20:$J$30,3,FALSE)
J2:J14J2=IF(J$1<=$D$1,VLOOKUP($A2,'Share Data'!$B$20:$J$30,3,FALSE),"")
E8:E14,E2:E6E2=D2*B2/100
E7E7=D7*B7
E15E15=IF(D15="","",D15*B15/100)
E16:F16E16=SUM(E2:E11)
E17:F17E17=SUM(E12:E15)
E18:F18E18=E16+E17
J18:N18J18=IF(J2="","",(SUMPRODUCT(J2:J6,$B$2:$B$6)+SUMPRODUCT(J8:J14,$B$8:$B$14))/100+J7*$B$7)
E20E20=E18-$K18
F20F20=E20/Q18
E21E21=$E$18-$L$18
F21F21=E21/$L$18
E22E22=$E$18-$W$18
F22F22=E22/$W$18
J20:N20J20=IF(J18="","",J18-$X$18)
J21:N21J21=IF(J18="","",(J18-K18)/K18)
J22:N22J22=IF(J18="","",(J18-$X$18)/$X$18)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F22Other TypeIcon setNO
F22Other TypeIcon setNO
E22Other TypeIcon setNO
E22Other TypeIcon setNO
G20Other TypeIcon setNO
G20Other TypeIcon setNO
F21Other TypeIcon setNO
F21Other TypeIcon setNO
G11Other TypeIcon setNO
G11Other TypeIcon setNO
H11:I11Other TypeIcon setNO
H11:I11Other TypeIcon setNO
F20Other TypeIcon setNO
F20Other TypeIcon setNO
E21Other TypeIcon setNO
E21Other TypeIcon setNO
E20Other TypeIcon setNO
E20Other TypeIcon setNO
F15Other TypeIcon setNO
F15Other TypeIcon setNO
H14:I14Other TypeIcon setNO
H14:I14Other TypeIcon setNO
G12Other TypeIcon setNO
G12Other TypeIcon setNO
G13Other TypeIcon setNO
G13Other TypeIcon setNO
G14Other TypeIcon setNO
G14Other TypeIcon setNO
G15:G17Other TypeIcon setNO
G15:G17Other TypeIcon setNO
H15:I17Other TypeIcon setNO
H15:I17Other TypeIcon setNO
G10Other TypeIcon setNO
G10Other TypeIcon setNO
H2:I3Other TypeIcon setNO
H2:I3Other TypeIcon setNO
G2:G9Other TypeIcon setNO
G2:G9Other TypeIcon setNO
H4:I10Other TypeIcon setNO
H4:I10Other TypeIcon setNO
H12:I13Other TypeIcon setNO
H12:I13Other TypeIcon setNO
 
Upvote 0
Is this what you want
Excel Formula:
=E18-INDEX(J18:W18,MATCH(EOMONTH(D1,-12),J1:W1,0))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,217,382
Messages
6,136,240
Members
450,000
Latest member
jgp19

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