7
$\begingroup$

Is there a methodology that would work well for replacing Excel with Mathematica?

Typically I use Excel to make various lists of values with formulae that relate those values. Below is a very typical example of a spreadsheet I might make showing radar range equations. I color input cells blue and computed cells are left black. It is very easy and simple to do:

enter image description here

Is there an equally easy approach to generating and organizing information like this in Mathematica?

UPDATE: I would like to re-open this question with the specific solution idea of using 2D Tables/Matrices. I did not realize this ability existed to create 2D input arrays using Mathematica.

Can I use 2D input arrays to simulate spreadsheet functionality?

$\endgroup$
15
  • $\begingroup$ Something like TableView[]? $\endgroup$
    – garej
    Commented Mar 3, 2016 at 20:53
  • $\begingroup$ @garej That just produces output. You cannot edit the cells of a TableView directly as far as I know. $\endgroup$ Commented Mar 3, 2016 at 20:54
  • 7
    $\begingroup$ As the question specifically requests "equally easy approach", the answer is simply no. I would say, this is many orders of magnitude more complicated in mathematica. But I think that stems from the confusion of the purpose of each software. You probably would not like to use Mathematica instead of CorelDraw or Photoshop... $\endgroup$
    – atapaka
    Commented Mar 3, 2016 at 20:58
  • 2
    $\begingroup$ Here is maybe a start? $\endgroup$
    – Emy
    Commented Mar 3, 2016 at 22:14
  • 2
    $\begingroup$ Mathematica Link for Excel is an excellent product for getting the best from both worlds. Some bucks involved, though. $\endgroup$ Commented Mar 3, 2016 at 23:25

2 Answers 2

6
$\begingroup$

To get empty sheet

tmp = TableView[]

Then enter some values and use Normal to derive the result as MMA list:

enter image description here

Result:

{{}, {Null, "Value1", "Value2"}, {"Normal", 3, 6}, {"Vector", 4, 7}}

Back to Table:

%//TableView

Of course, it is not recommended to emulate cell reference system of Excel in Mathematica.

$\endgroup$
5
  • $\begingroup$ Do not need to do that. Just want to have a table-like input form with things lined up in columns and editable so users can enter input values without having to edit code. $\endgroup$ Commented Apr 9, 2016 at 20:11
  • $\begingroup$ I consider it a weakness of Mathematica that you can't do reactive programming well. $\endgroup$
    – Michael
    Commented Feb 21, 2020 at 2:58
  • $\begingroup$ @Michael , what is reactive programming? $\endgroup$
    – garej
    Commented Mar 3, 2020 at 12:36
  • $\begingroup$ The classic example would be a spreadsheet, where as soon as you update a value all of its dependencies are recalculated. Like Dynamic. $\endgroup$
    – Michael
    Commented Mar 3, 2020 at 14:31
  • $\begingroup$ @Michael , but we may in principle mimic it via “Rule-based programming”. $\endgroup$
    – garej
    Commented Mar 3, 2020 at 14:36
4
$\begingroup$
x = Table[0, {3}, {3}];
Grid[Table[ InputField[Dynamic[x[[#[[1]], #[[2]]]],
      Initialization -> (x[[Sequence @@ #]] := Null)]] &@{i, j},
  {i, 3}, {j, 3}]]
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.