Skip to main content

Implementing Nested FOR Loops as Spreadsheet Formulas

  • Conference paper
  • First Online:
Software Technologies: Applications and Foundations (STAF 2016)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 9946))

  • 833 Accesses

Abstract

A FOR loop is a computing structure that allows a set of calculations to be made repeatedly for each iteration of the loop where the number of iterations is known in advance. A nested loop happens when a loop is inside another loop. In a spreadsheet program like Microsoft Excel, one can program loops in VBA, its programming language. Spreadsheet developers who do not know how to program in VBA usually implement the equivalent of loops with static values (e.g. region codes and product types are typed as constants) or with formulas (e.g. the region code is the previous region code + 1). In this paper, we present similarities and differences between programming loops and spreadsheet formulas loops. We also present a set of formulas that implement nested loops for 1, 2 or 3 nested levels, along with a generalization for deeper nesting levels. We also provide model management formulas to help the spreadsheet developer ensure that his spreadsheet model covers all the iterations.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Panko, R.R.: What we know about spreadsheet errors. J. End User Comput. 10, 15–21 (2008)

    Article  Google Scholar 

  2. Burden, T.: How a Rookie excel error led JPMorgan to misreport its VaR for years (2013). http://www.zerohedge.com/news/2013-02-12/how-rookie-excel-error-led-jpmorgan-misreport-its-var-years

  3. Mouchel profits blow (2011). http://www.express.co.uk/finance/city/276053/Mouchel-profits-blow

  4. Conczal, M.: Researchers finally replicated Reinhart-Rogoff, and there are serious problems. Roosevelt Institute (2013). http://rooseveltinstitute.org/researchers-finally-replicated-reinhart-rogoff-and-there-are-serious-problems/

  5. Jones, S.P., Blackwell, A., Burnett, M.: A user-centred approach to functions in excel. ACM Sigplan Not. 38, 165–176 (2003)

    Article  Google Scholar 

  6. Erwig, M.: Software engineering for spreadsheets. IEEE Softw. 26, 25–30 (2009)

    Article  Google Scholar 

  7. Cunha, J., Fernandes, J.P., Mendes, J., Saraiva, J.: MDSheet: a framework for model-driven spreadsheet engineering. In: Presented at the Proceedings of the 34th International Conference on Software Engineering, Zurich, Switzerland (2012)

    Google Scholar 

  8. Mireault, P.: Structured spreadsheet modeling and implementation. In: 2nd Workshop on Software Engineering Methods in Spreadsheets, Firenze, IT (2015)

    Google Scholar 

  9. Mireault, P.: Structured Spreadsheet Modelling and Implementation: A Methodology for Creating Effective Spreadsheets. SSMI International, Montréal (2016)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Paul Mireault .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing AG

About this paper

Cite this paper

Mireault, P. (2016). Implementing Nested FOR Loops as Spreadsheet Formulas. In: Milazzo, P., Varró, D., Wimmer, M. (eds) Software Technologies: Applications and Foundations. STAF 2016. Lecture Notes in Computer Science(), vol 9946. Springer, Cham. https://doi.org/10.1007/978-3-319-50230-4_31

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-50230-4_31

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-50229-8

  • Online ISBN: 978-3-319-50230-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics