---
title: "Automating String Processing in Spreadsheets Using"
description: "People usually describe these tasks by showing sample inputs with the outputs they want. 23 references, cited by 63 papers here."
authors: ["Sumit Gulwani"]
year: 2011
venue: "POPL 2011"
source: "https://www.microsoft.com/en-us/research/wp-content/uploads/2016/12/popl11-synthesis.pdf"
licence: "Microsoft Research — author's copy, read only"
summary_licence: "Elamur Cosmic License"
canonical: "https://research.elamur.ai/free/en/papers/gulwani-2011-automating-string-processing-spreadsheets-input/"
---
[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/gulwani-2011-automating-string-processing-spreadsheets-input/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2011](https://md.research.elamur.ai/free/en/papers/2011/) / Automating String Processing in Spreadsheets Using Input-Output Examples

# Automating String Processing in Spreadsheets Using Input-Output Examples

**Authors:** [Sumit Gulwani](https://md.research.elamur.ai/free/en/authors/sumit-gulwani/) · **Year:** 2011 · **Venue:** POPL 2011 · **Publisher:** [Association for Computing Machinery](https://md.research.elamur.ai/free/en/publishers/association-for-computing-machinery/) · **Licence:** Microsoft Research — author's copy, read only

**Links:** [Publisher's page](https://doi.org/10.1145/1925844.1926423) · [PDF](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/12/popl11-synthesis.pdf) · [OpenAlex](https://openalex.org/W2132525863)

**Citations:** 572 citations (OpenAlex, 2026-10-14) · [63](https://md.research.elamur.ai/free/en/papers/gulwani-2011-automating-string-processing-spreadsheets-input/cited-by/) in our library, of the 149,439 papers whose bibliographies we read

## Summary
Many spreadsheet users are not programmers, yet they often need to reformat or extract text such as names, phone numbers and dates. Writing macros or scripts for this is beyond most of them. Gulwani studied Excel help forums and found two things. People usually describe these tasks by showing sample inputs with the outputs they want. Settling the details with a human expert can take several rounds over days. The paper defines a string expression language that concatenates constant strings and substrings. Substring boundaries are found with token-based regular expressions, and the language also supports conditionals (Switch) and loops. A synthesis algorithm based on version-space algebra finds every program in this language that fits the given examples, storing candidate concatenations compactly as DAGs. Extensions rank the candidates, spot likely errors in the user's examples, and ask the user about inputs that could be read in more than one way. The method was built as a Microsoft Excel add-in and answers each interaction round in a fraction of a second. It shows that programming by example can be fast and practical for everyday users.

## Key points
- The motivation is the more than 500 million spreadsheet users, for whom manipulating text ranks among the programming problems they face most often.
- The language's constructors include Concatenate, SubStr, ConstStr, Loop and Switch, and positions are given as CPos(k) or Pos(r1, r2, c).
- Response time averages under 0.1 s per interactive round, and the system usually converges within 1–4 rounds of examples.
- The system is fully automatic, with no annotations needed from the user. It tolerates noise in the examples and suggests which inputs the user should label next.
- The prototype Excel add-in passed what the author calls the "golden test": it synthesized part of its own code.

*Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.*

## Institutions

- [Microsoft](https://md.research.elamur.ai/free/en/companies/microsoft/) — Company, Redmond, United States · 378 works · 161,630 citations

📚 Shelves (4): [🖥️ Computer Science](https://md.research.elamur.ai/free/en/shelves/computer-science/) · 18,614 works · [🤖 Artificial Intelligence](https://md.research.elamur.ai/free/en/shelves/computer-science/artificial-intelligence/) · 17,965 works · [💻 Software](https://md.research.elamur.ai/free/en/shelves/computer-science/software/) · 119 works · [🖥️ Computer Science Applications](https://md.research.elamur.ai/free/en/shelves/computer-science/computer-science-applications/) · 131 works

## Cite

Cite as: Sumit Gulwani. 2011. Automating String Processing in Spreadsheets Using Input-Output Examples. POPL 2011.

The paper itself, not this page. BibTeX from the library's record of the work.

```bibtex
@inproceedings{gulwani2011automating,
  title = {{Automating String Processing in Spreadsheets Using Input-Output Examples}},
  author = {Sumit Gulwani},
  booktitle = {POPL 2011},
  year = {2011},
  doi = {10.1145/1925844.1926423},
  url = {https://doi.org/10.1145/1925844.1926423}
}
```

- [← previous A Class of Submodular Functions for Document Summarization](https://md.research.elamur.ai/free/en/papers/lin-2011-class-submodular-functions-document-summarization/)
- [next → Discriminating Gender on Twitter](https://md.research.elamur.ai/free/en/papers/burger-2011-discriminating-gender-twitter/)
- [↑ back to papers of 2011](https://md.research.elamur.ai/free/en/papers/2011/)

## References

23 references, 0 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

1. D. Angluin. Learning regular sets from queries and counterexamples. Inf. Comput., 75(2):87–106, 1987. [find](https://scholar.google.com/scholar?q=D%2E+Angluin%2E+Learning+regular+sets+from+queries+and+counterexamples%2E+Inf%2E+Comput%2E%2C+75%282%29%3A87%E2%80%93106%2C+1987%2E)
2. K. Fisher and R. Gruber. PADS: a domain-specific language for processing ad hoc data. In PLDI, pages 295–304, 2005. [find](https://scholar.google.com/scholar?q=K%2E+Fisher+and+R%2E+Gruber%2E+PADS%3A+a+domain%2Dspecific+language+for+processing+ad+hoc+data%2E+In+PLDI%2C+pages+295%E2%80%93304%2C+2005%2E)
3. K. Fisher, Y. Mandelbaum, and D. Walker. The next 700 data description languages. In POPL, pages 2–15, 2006. [find](https://scholar.google.com/scholar?q=K%2E+Fisher%2C+Y%2E+Mandelbaum%2C+and+D%2E+Walker%2E+The+next+700+data+description+languages%2E+In+POPL%2C+pages+2%E2%80%9315%2C+2006%2E)
4. K. Fisher, D. Walker, K. Q. Zhu, and P. White. From dirt to shovels: fully automatic tool generation from ad hoc data. In POPL, 2008. [find](https://scholar.google.com/scholar?q=K%2E+Fisher%2C+D%2E+Walker%2C+K%2E+Q%2E+Zhu%2C+and+P%2E+White%2E+From+dirt+to+shovels%3A+fully+automatic+tool+generation+from+ad+hoc+data%2E+In+POPL%2C+2008%2E)
5. M. Gualtieri. Deputize end-user developers to deliver business agility and reduce costs. In Forrester Report for Application Development and Program Management Professionals, April 2009. [find](https://scholar.google.com/scholar?q=M%2E+Gualtieri%2E+Deputize+end%2Duser+developers+to+deliver+business+agility+and+reduce+costs%2E+In+Forrester+Report+for+Application+Development+and+Program+Management+Professionals%2C+April+2009%2E)
6. S. Gulwani. Dimensions in program synthesis. In PPDP. ACM, 2010. [find](https://scholar.google.com/scholar?q=S%2E+Gulwani%2E+Dimensions+in+program+synthesis%2E+In+PPDP%2E+ACM%2C+2010%2E)
7. S. Gulwani and G. C. Necula. A polynomial-time algorithm for global value numbering. In SAS, pages 212–227, 2004. [find](https://scholar.google.com/scholar?q=S%2E+Gulwani+and+G%2E+C%2E+Necula%2E+A+polynomial%2Dtime+algorithm+for+global+value+numbering%2E+In+SAS%2C+pages+212%E2%80%93227%2C+2004%2E)
8. S. Jha, S. Gulwani, S. Seshia, and A. Tiwari. Oracle-guided component-based program synthesis. In ICSE, 2010. [find](https://scholar.google.com/scholar?q=S%2E+Jha%2C+S%2E+Gulwani%2C+S%2E+Seshia%2C+and+A%2E+Tiwari%2E+Oracle%2Dguided+component%2Dbased+program+synthesis%2E+In+ICSE%2C+2010%2E)
9. A. J. Ko, B. A. Myers, and H. H. Aung. Six learning barriers in end-user programming systems. In VL/HCC, pages 199–206, 2004. [find](https://scholar.google.com/scholar?q=A%2E+J%2E+Ko%2C+B%2E+A%2E+Myers%2C+and+H%2E+H%2E+Aung%2E+Six+learning+barriers+in+end%2Duser+programming+systems%2E+In+VL%2FHCC%2C+pages+199%E2%80%93206%2C+2004%2E)
10. T. Lau. Why PBD systems fail: Lessons learned for usable AI. In CHI 2008 Workshop on Usable AI, Florence, Italy, 2008. [find](https://scholar.google.com/scholar?q=T%2E+Lau%2E+Why+PBD+systems+fail%3A+Lessons+learned+for+usable+AI%2E+In+CHI+2008+Workshop+on+Usable+AI%2C+Florence%2C+Italy%2C+2008%2E)
11. T. Lau, S. Wolfman, P. Domingos, and D. Weld. Programming by demonstration using version space algebra. Machine Learning, 53(1-2), 2003. [find](https://scholar.google.com/scholar?q=T%2E+Lau%2C+S%2E+Wolfman%2C+P%2E+Domingos%2C+and+D%2E+Weld%2E+Programming+by+demonstration+using+version+space+algebra%2E+Machine+Learning%2C+53%281%2D2%29%2C+2003%2E)
12. T. Lau, L. Bergman, V. Castelli, and D. Oblinger. Programming shell scripts by demonstration. In Workshop on SCLAS, AAAI, 2004. [find](https://scholar.google.com/scholar?q=T%2E+Lau%2C+L%2E+Bergman%2C+V%2E+Castelli%2C+and+D%2E+Oblinger%2E+Programming+shell+scripts+by+demonstration%2E+In+Workshop+on+SCLAS%2C+AAAI%2C+2004%2E)
13. T. A. Lau, P. Domingos, and D. S. Weld. Version space algebra and its application to programming by demonstration. In ICML, 2000. [find](https://scholar.google.com/scholar?q=T%2E+A%2E+Lau%2C+P%2E+Domingos%2C+and+D%2E+S%2E+Weld%2E+Version+space+algebra+and+its+application+to+programming+by+demonstration%2E+In+ICML%2C+2000%2E)
14. T. A. Lau, P. Domingos, and D. S. Weld. Learning programs from traces using version space algebra. In K-CAP, pages 36–43, 2003. [find](https://scholar.google.com/scholar?q=T%2E+A%2E+Lau%2C+P%2E+Domingos%2C+and+D%2E+S%2E+Weld%2E+Learning+programs+from+traces+using+version+space+algebra%2E+In+K%2DCAP%2C+pages+36%E2%80%9343%2C+2003%2E)
15. R. C. Miller and B. A. Myers. Interactive simultaneous editing of multiple text regions. In USENIX Annual Technical Conference, 2001. [find](https://scholar.google.com/scholar?q=R%2E+C%2E+Miller+and+B%2E+A%2E+Myers%2E+Interactive+simultaneous+editing+of+multiple+text+regions%2E+In+USENIX+Annual+Technical+Conference%2C+2001%2E)
16. T. M. Mitchell. Generalization as search. Artif. Intell., 18(2), 1982. [find](https://scholar.google.com/scholar?q=T%2E+M%2E+Mitchell%2E+Generalization+as+search%2E+Artif%2E+Intell%2E%2C+18%282%29%2C+1982%2E)
17. R. P. Nix. Editing by example. TOPLAS, 7(4):600–621, 1985. [find](https://scholar.google.com/scholar?q=R%2E+P%2E+Nix%2E+Editing+by+example%2E+TOPLAS%2C+7%284%29%3A600%E2%80%93621%2C+1985%2E)
18. S. Russell and P. Norvig. Artificial Intelligence: A Modern Approach (2nd Edition). Prentice Hall, 2 edition, December 2002. [find](https://scholar.google.com/scholar?q=S%2E+Russell+and+P%2E+Norvig%2E+Artificial+Intelligence%3A+A+Modern+Approach+%282nd+Edition%29%2E+Prentice+Hall%2C+2+edition%2C+December+2002%2E)
19. S. Srivastava, S. Gulwani, and J. Foster. From program verification to program synthesis. In POPL, 2010. [find](https://scholar.google.com/scholar?q=S%2E+Srivastava%2C+S%2E+Gulwani%2C+and+J%2E+Foster%2E+From+program+verification+to+program+synthesis%2E+In+POPL%2C+2010%2E)
20. J. M. Vilar. Query learning of subsequential transducers. In Proceedings of the 3rd International Colloquium on Grammatical Inference, 1996. [find](https://scholar.google.com/scholar?q=J%2E+M%2E+Vilar%2E+Query+learning+of+subsequential+transducers%2E+In+Proceedings+of+the+3rd+International+Colloquium+on+Grammatical+Inference%2C+1996%2E)
21. J. Walkenbach. Excel 2010 Formulas. John Wiley and Sons, 2010. [find](https://scholar.google.com/scholar?q=J%2E+Walkenbach%2E+Excel+2010+Formulas%2E+John+Wiley+and+Sons%2C+2010%2E)
22. I. H. Witten and D. Mo. TELS: learning text editing tasks from examples. In Watch what I do: programming by demonstration, pages 293–307. MIT Press, Cambridge, MA, USA, 1993. [find](https://scholar.google.com/scholar?q=I%2E+H%2E+Witten+and+D%2E+Mo%2E+TELS%3A+learning+text+editing+tasks+from+examples%2E+In+Watch+what+I+do%3A+programming+by+demonstration%2C+pages+293%E2%80%93307%2E+MIT+Press%2C+Cambridge%2C+MA%2C+USA%2C+1993%2E)
23. Q. Xi and D. Walker. A context-free markup language for semi-structured text. In PLDI, pages 221–232, 2010. [find](https://scholar.google.com/scholar?q=Q%2E+Xi+and+D%2E+Walker%2E+A+context%2Dfree+markup+language+for+semi%2Dstructured+text%2E+In+PLDI%2C+pages+221%E2%80%93232%2C+2010%2E)

*Updated 2 November 2026*
