# Interpolating data from Excel

Sorry for the probably mainstream question, but I have not found the answer I was looking for yet.

I have this Excel file: https://drive.google.com/file/d/1UhkYdoaqXQIsf6opOx-EBgG7xPxxHga3/view and I want to import the two-column data therein, define a function $$g(t)$$ from their interpolation and plot it.

I have tried simple code lines as

mydata = Import["gstar.xlsx"]
g = Interpolation[mydata]


but it gives me the error message Interpolation::inder: The order-2 derivative of {0.000101685,4.13102} is not a tensor of rank 2 with dimensions 2.

I have also tried with g = ListInterpolation[mydata], but I get ListInterpolation::inhr: Requested order is too high; order has been reduced to {0,3,1}.

I don't understand what are the problems. In fact, if I try to plot the list of data with ListLogLogPlot[mydata] I am able to visualize the data and it seems that the import process was actually successful.

• Remove the chart from input excel file; or try mydata2 = Import["gstar.xlsx", {"Data", 1, All, ;; 2}]; Interpolation[mydata2]?
– kglr
Aug 22, 2019 at 16:57
• Sorry for the chart, but it doesn't affect the problem. However, it seems that your second method works, thank you! May you explain the syntax {"Data", 1, All, ;; 2} to me?
– Lele
Aug 22, 2019 at 17:16
• Lele, posted the comment as answer.
– kglr
Aug 22, 2019 at 17:30

mydata2 = Import["gstar.xlsx", {"Data", 1, All, ;; 2}];

{"Data", sheetlist, rowlist, columnlist} specification extracts data from sheets in sheetlist the rows in rowlist and columns in columnlist. So {"Data", 1, All, ;; 2} says "get the array of data in columns 1 and 2 form all rows of sheet 1".
See XLSX >> Import Elements for further examples.