Skip to content

Commit

Permalink
add Office sw - spreadsheet concatenate w & operator
Browse files Browse the repository at this point in the history
  • Loading branch information
drecali committed Jul 14, 2022
1 parent 8d6c072 commit e41aacc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This repo is inspired by the [@jbrandchaud/til](https://github.com/jbranchaud/ti
- [Jira](#jira)
- [Markdown](#markdown)
- [Material UI](#material-ui)
- [Office Software](#office-software)
- [Scrum](#scrum)
- [SVG](#svg)
- [VS Code](#vs-code)
Expand Down Expand Up @@ -91,6 +92,10 @@ This repo is inspired by the [@jbrandchaud/til](https://github.com/jbranchaud/ti

- [`sx` prop interprets `number` values inconsistently](material-ui/sx-prop-interprets-number-values-inconsistently.md)

### Office Software

- [`[Spreadsheet]` - Concatenate with `&` operator](office-software/spreadsheet-concatenate-with-ampersand.md)

### Scrum

- [Scrum Poker Online (free and quick)](scrum/scrum-poker-online-free-quick.md)
Expand Down
23 changes: 23 additions & 0 deletions office-software/spreadsheet-concatenate-with-ampersand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# `[Spreadsheet]` - Concatenate with `&` operator

In Spreadsheet software like Google Sheets or Microsoft Office, the `&` operator does 2 beautiful things:

- Converts the output of the 2 elements on either side of it as `strings`
- Joins the `string` outputs

```sh
= 0 & 5 # 05
= 'con' & 'cat' # concat
```

It's especially useful for summary cells when you want to show 2 values in the same cell or format a value in an uncommon way that may not be built in to the spreadsheet software (or you don't feel like finding it). For example:

```sh
= SUM(A1:A10) & 'mL' # 500mL
= 'Total: ' & SUM(A1:A10) & ` | Avg: ` & AVERAGE(A1:A10) # Total: 500 | Avg: 250
```

## Resources

- [Excel Operators](<https://excelx.com/formula/operators/#:~:text=%2C%3DA2%2DA1-,Concatenation%20Operator,result%20will%20be%20a%20string.&text=We%20can%20use%20%26(Ampersand)%20Operator%20to%20concatenate%20two%20strings.>)
- [Google Sheets Knowledge Base](https://support.google.com/docs/thread/8978489/displaying-two-separate-formulas-in-one-cell-in-sheets?hl=en)

0 comments on commit e41aacc

Please sign in to comment.