Search This Blog

Monday, March 21, 2016

Uses of Excel for developers

Many developers don't even think that they could get some help with an "old" tool we mostly all have: Excel (or other spreadsheet software).

How can Excel help us will you ask and I shall try to give you some examples where I do use Excel and maybe that will trigger you some new ideas how to use it yourself.

Create fake data in your tables
When you develop applications and need some data in your tables to see if your software works, Excel can be your best friend. To do it, you simply do as your would fill an excel list, and the last column can be used to compose the SQL command. String concatenation in excel is done via the "&" operator, and double quotes escapes are done by placing a double quote in front (""). Something like
="INSERT INTO tableABC(Id,Name) VALUES("&A1&",'"&B1&"');"

As Excel can generate lines for you, being random values or simply sequences. Random values can be done using the Excel function RAND:
=ROUND(RAND()*100,0)

Sequences is simply matter of dragging the small "+" sign in the corner of the cell and excel shall create the sequence for you.

Create or update data
Same as the previous example, you can export your data to excel and update it on a easier to use interface or create data (with formula) and then generate your SQL statements.

Try some formula
Many times when you develop games or any stat software you will need to tweak some formula or actually create some. For example to know how many Experience points you need to level up, or how much damage each level of quality a sword will do. Excel can be used to see how those number are progressing. On the first column you have the "level" and the second you can place your formula and see how the 2 are related and how good is your formula.

Try curves
Excel do have some simple plotting tool which can be used to see the shape of simple or not so simple math functions. You can also try to see how your data are compared to a formula, however don't expect to have all the features of a statistic tool or a mathematical tool like Mathlab. Yet excel can even plot 3D surfaces and you could see if your terrain function seems ok or simply garbage.

Reports
Instead of producing PDF or HTML reports, ever thought about producing formatted or not formatted Excel files? The advantage for your customers is that they could continue to work with the data you produced, and the advantage for you is that it may at the end save you time trying to produce all the kind of reports they may want. I'm not talking about full data dump here, but more pre-digested data. In a previous post ( here ) I explained how to directly produce Excel files out of your Javascript, well the same can be done on the server side (it doesn't matter if your server is running on Linux or Windows, nor it matters what language you use).

Offline work
Here it may require more work, but I used it for a software at work. Some people may want to work with data while not being connected, one option would be to write some macros and pull / push data from your application into excel. The advantage is that you can then work offline, and when you are back online you can push back the modifications. You could also block some cells such that only some fields can be updated.

Visual Studio offers something similar using excel to edit multiple TFS rows, so if even Microsoft uses Excel for such things why shouldn't we?

Conclusion
As you see the usages you can have with excel are nearly infinite and some times it can be really a life saver.

No comments:

Post a Comment