Extracting logic from XLS to a web app

Extracting logic from XLS to a web app


In Brezza Screens Systems we use custom software to generate quote estimates of our window screens (mosquiteros). This has enabled us to serve much more customers with increased quality standards and reliability.

Previously, when a customer would ask how much does a Window Screen costs, we would use Excel to quote an estimate. That process was slow and required slow thinking, meaning that it required high level of focus to avoid making any mistake. Even though Excel is a powerful app, it is very easy to accidentally mess up a formula. Additionally, there is a potential risk when copying an existing Excel sheet to reuse it for another customer.

Case: Esperto Window Screen

In this case there is a group of formulas to calculate the amount and length of threads that we should consider in our model Esperto Window Screen


Example of XLS formula to calculate strings
Example of XLS formula to calculate strings
These are the formulas for the length each of the 5 threads.
XLS formulas for each thread

Example of how to understand a messy spreadsheet formula

In this case the formula is hard to read because it has a lot of conditionals and it is all in one line.

Example of how spreadsheet formulas can be hard to read

Formatting the formula allows an easier understanding. I use VSCode for that. I also replace the cell numbers with variable names. In this case I replaced `I4` for `height`.

formatted formula

Then I flatten the structure so it is easier to read.

flattened formula

Now it is easier to see how many threads should there be for each threshold of height size. Finally I rewrite this formula in Rescript and I plug it into our quote estimator app to have that logic in our pricing calculations.

No alt text provided for this image

This way we have the logic in an app that can display only the details that the user needs to make a quote. The calculation logic is protected from any human error from the user by moving it into Rescript code and writing unit tests that will run automatically during development and before publishing a new version of the app. This makes our quotes quicker and more reliable.

要查看或添加评论,请登录

Jorge Cuadra的更多文章

  • Extraer logica de Excel a un web app

    Extraer logica de Excel a un web app

    English version is available En Brezza Screens Systems usamos software a la media para calcular cotizaciones de…

    2 条评论
  • Javascript arrow functions are overhyped

    Javascript arrow functions are overhyped

    Since Javascript upgraded to ES2015, I have frequently seen many developers defaulting to arrow functions instead of…

    1 条评论
  • Knowledge Debt in Software Development

    Knowledge Debt in Software Development

    Knowledge Debt is the accumulation of knowledge gaps. In Software Development terms, it is like Technical Debt but for…

    4 条评论
  • How to use babel for production

    How to use babel for production

    babel-node not meant for production use Read the full article

  • On consumption and productivity

    On consumption and productivity

    Many personal finance coaches say that there is good debt and bad debt. The good debt is the one that you can leverage…

    2 条评论

社区洞察

其他会员也浏览了