As per my understanding, you are reading an excel in a datatable and checking the headers of the datatable. Whenever you find the value “Feb-19” then you want to return 783.61.
If my understanding is correct then please consider the below approach:-
Firstly have the inputted value in the variable (Value = “Feb-19”) (Please mind the case sensitivity)
Read range to read the entire excel into the datatable variable (select AddHeaders). (lets say dtResult)
Using the following LINQ assign operator, you can get all the column names:
arrColumnnames = (From dc In dtResult.Columns.Cast(Of DataColumn)
where arrColumnnames is a string array.
Now, using For each item in arrColumnnames
if (item.tostring.contains(Value)) then fetch the value below it.
Thanks and Regards,