I need some help for one task. following is my excel sheet in tat i want to take data from cell based on headers i.e. kind of we lookup i want to take a cell value(8.93) from excel sheet. it should check Age Band/Tenure (age as 36-40) and upper header as 3. how can i do it can anyone help me out in this…
If you have the values for Age Band and Tenure you can apply the following logic:
Read your excel file and save it in a variable vDataTable
Use a linq expression to get the row with the desired value vDataTable.AsEnumerable().Where(function(r) r.item(“Age Band/Tenure”).Equals(Age Band)).First().Item(Tenure)
Be careful, if your combination of Age Band and Tenure doesn’t exist is going to throw you an error.