Quiet@Remove["Global`*"];
$HistoryLength=2;
SetDirectory[NotebookDirectory[]];

Rtry=100;
Ctry=5*(10^(-6));
Y[f_]:=(1/Rtry)+I*2*Pi*Ctry*f;
ParametricPlot[{Re[(1/(Y[f]))],Im[(1/(Y[f]))]},{f,0,(10^5)},PlotRange->All,PlotPoints->300,PlotStyle->Thick];

dats=Import["data.xls"][[1]];
ListPlot[dats/.{f_,R_,X_}:>{R,X}];

bod[f_]:={f,Re[(1/(Y[f]))],Im[(1/(Y[f]))]}//N;
fmin=10;
fmax=10000;
nfrekvenci=100;
q=qpom/.FindRoot[fmin*(qpom^(nfrekvenci-1))==fmax,{qpom,1.1}];
frekvence=fmin*(q^(#-1))&/@Range[nfrekvenci];
body=bod/@frekvence;

Z[f_]:=((R*(1/(I*2.*Pi*f*c)))/(R+(1/(I*2.*Pi*f*c))));
odchylka[{f_,R_,X_}]:=Abs[R+I*X-Z[f]];
proFindMin=Plus@@(odchylka/@body);
FindMinimum[proFindMin,{c,(10^(-6))},{R,10},Method->"PrincipalAxis"]