←back to thread

291 points 1659447091 | 1 comments | | HN request time: 0.312s | source
Show context
mmooss ◴[] No.46341227[source]
My best Excel trick, which reveals how little I know, and yet Early [0] doesn't use it (or maybe doesn't need it, but that's hard to believe):

1. You can drag down the bottom of the formula bar/field and make it multi-line

2. You can insert arbitrary[*] newlines in an Excel formula

Combining those, you can turn the absurd default format of single-line-of-code functions into something readable and manageable. Here's a simple one from a spreadsheet I have open:

  =INDEX(
  $C$17:$S$24,
  MATCH(A6,$A$17:$A$24,0),
  MATCH(C6,$C$15:$S$15,0)
  )
And just think of highly nested functions. Once you know it, writing single-line functions of any complexity is absurd, as absurd as writing 'real' code that way.

[0] Early shows how it was done: https://news.ycombinator.com/item?id=46340638

[*] I think you can do it anywhere but I haven't tested anything crazy; mostly I just use them between expressions.

replies(6): >>46341744 #>>46342015 #>>46343809 #>>46344572 #>>46346758 #>>46347431 #
simonh ◴[] No.46343809[source]
It could be that in a competitive context fussing with formatting would cost precious seconds. Great general tip for us mortals though.
replies(1): >>46346504 #
1. mmooss ◴[] No.46346504[source]
Imagine a coding competition: Would you forgo newlines and write everything on one long line? Would that save time?

Perfect style guide format does consume time, but pressing Alt+Enter a few times would seem to reduce errors at essentially no cost.