# How to Export my results to an excel sheet I have a nonlinear equation in single variable( $$x \tan(x)=5$$ ) and it have an infinite number of roots , I got some of them and I want to add them in a table this is my code please, tell me how to do this?

(* In:= *) Reduce[x Tan[x] == 5 && 0 <= x <= 100, x]


then I used a ToRule to convert the || to

(* In:= *) ToRules[Out]


then I used export to export all roots to excel sheet but i got failed

Export["myfile.xls", Out]


Export::noelem: {x->Root[{-5+#1 Tan[Slot[<<1>>]]&,4.0335677903399816532}]} is not a valid set of export elements for the XLS format.

(* Out = \$Failed *)

• "this is my code" - where? May 9, 2020 at 3:37
• Reduce[x Tan[x] == 5 && 0 <= x <= 100, x] May 9, 2020 at 3:43
• n = ToRules[Out] May 9, 2020 at 3:44
• Edit your question to include this information, instead of leaving it in comments. May 9, 2020 at 3:44
• now you can see my code May 9, 2020 at 3:48

Actually, the conversion of Sequence into the List can be done easy:

   a=ToRules@Reduce[x Tan[x] == 5 && 0 <= x <= 100, x];
b=x /. List[a];
Export["file.xlsx", b]


The Export gives you an Excel file with the desired column of numbers

• Thank you very much , you did it May 9, 2020 at 5:08

I think you probably want to use NSolve instead of Reduce.

roots = x /. NSolve[x Tan[x] == 5 && 0 <= x <= 100, x]
Export["outfile.xls", roots]


This will produce a column of 32 roots, which I think is what you want.

• Thank you very much , you did it May 9, 2020 at 5:08