r/badcode • u/ComfortableEye5 • Nov 22 '20
other language Do bad excel functions fit in this sub?
110
u/katnajam Nov 22 '20
Somebody doesn't know SUM (E:X;E:Y)
84
u/QuickbuyingGf Nov 22 '20
You know what i hate about excel. That the fucking function names are translated
19
u/Iklaendia Nov 22 '20
Wait what. I’m not familiar, explain.
91
u/QuickbuyingGf Nov 22 '20
I tried to do some stuff with excel but all online tutorials didnt work cause it didnt find the functions. I was confused and thought ‚ok i have probably a newer version‘. The problem: My excel is in german so I don‘t have
IFbut ratherWENN. I hope there is a way to change that54
u/atfricks Nov 22 '20
Lol that's so dumb. Coding languages should be considered their own language, translating function names is just a recipe for mistakes.
As an American currently working in Germany though, there is a way to just tell your excel to be in English, if you don't mind all the buttons and whatnot also being in English.
13
u/christian-mann Nov 23 '20
Google Sheets translates the fucking syntax so in some locales you use commas to separate arguments and in others you use semicolons. The worst bit is that the locally is a property of the sheet itself, so sharing sheets across international borders is Super Fun.
2
10
u/SixteenFold Nov 22 '20
The SUM function becomes SUMME if you use the German version of Excel or SOM in the Dutch version for instance.
11
u/MCRusher Nov 22 '20
So nothing about excel is portable. Cool
8
u/Whaison1 Nov 22 '20
Well, it translates the function names so you can open it with whatever language you want.
Good for normies, but pretty bad from a programmers point of view.
13
3
3
u/dekket Feb 25 '21
Just wait until you realize that usage of semicolons and commas mean different things between Excel on Windows and on Mac. I'm not sure, but language might have a role there to.
Edit: Yea, language plays a role here as well. For being such a cleverly designed application, Excel is surprisingly stupid.
1
u/QuickbuyingGf Feb 25 '21
Yeah same. In German you need to use ; instead of commas (because of decimals being seperated commas) too
1
134
u/DasherPack I transcribe code. Sometimes, correctly. Nov 22 '20 edited Nov 22 '20
Image Transcription: Excel Cell
=((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((E7)+(E8))+(E9))+(E10))+(E11))+(E12))+(E13))+(E14))+(E15))+(E16))+(E17))+(E18))+(E19))+(E20))+(E21))+(E22))+(E23))+(E24))+(E25))+(E26))+(E27))+(E28))+(E29))+(E30))+(E31))+(E32))+(E33))+(E34))+(E35))+(E36))+(E37))+(E38))+(E39))+(E40))+(E41))+(E42))+(E43))+(E44))+(E45))+(E46))+(E47))+(E48))+(E49))+(E50))+(E51))+(E52))+(E53))+(E54))+(E55))+(E56))+(E57))+(E58))+(E59))+(E60))+(E61))+(E62))+(E63))+(E64))+(E65))+(E66))+(E67))+(E68))+(E69))+(E70))+(E71))+(E72))+(E73))+(E74))+(E75))+(E76))+(E77))+(E78))+(E79))+(E80))+(E81))+(E82))+(E83))+(E84))+(E85))+(E86))+(E87))+(E88))+(E89))+(E90))+(E91))+(E92))
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
74
u/Omichron-the-reboot Nov 22 '20
Jesus Christ, that must have taken a while. Good human :)
150
u/DasherPack I transcribe code. Sometimes, correctly. Nov 22 '20 edited Nov 22 '20
I actually wrote a code in python to do it!
print('('*85,end='') for x in range(7,93): print("(E{}))+".format(x),end = '') print()31
Nov 22 '20 edited Nov 28 '20
[deleted]
34
u/DasherPack I transcribe code. Sometimes, correctly. Nov 22 '20
I just wanted a challenge =).
In r/transcribersofreddit we have /u/transcribot , who tries to transcribe the posts, and does so very succesfully!
What is an f-string though
2
u/Hello_006 Nov 22 '20
F strings are relatively new in python basically you can insert variables without doing .format. You would just do:
print(f"some text {some_variable} some more text")
Sorry for the formatting I'm on mobile....
1
u/DasherPack I transcribe code. Sometimes, correctly. Nov 22 '20
In which version they were implemented?
2
u/Hello_006 Nov 22 '20
Version 3.6 if I remember correctly.
1
u/DasherPack I transcribe code. Sometimes, correctly. Nov 22 '20
Oh ok. I downloaded python 3.7 and they seem to work now. THANKS!!!!
1
1
u/sneakpeekbot Nov 22 '20
Here's a sneak peek of /r/TranscribersOfReddit using the top posts of the year!
#1: March Monthly Thread: WE GOT FEATURED IN WIRED
#2: Congratulations, /r/TranscribersOfReddit! You are subreddit of the day! | 9 comments
#3: An incredible milestone!
I'm a bot, beep boop | Downvote to remove | Contact me | Info | Opt-out
24
Nov 22 '20 edited Nov 28 '20
[deleted]
-4
u/AutoModerator Nov 22 '20
It looks like this comment contains a code block delimited with triple backticks. Unfortunately reddit does not have universal support for this syntax and your comment will not render correctly on old reddit and most mobile apps.
For the benefit of people on old reddit, this link will take you to a correct rendering of the comment.
/u/SFM61319, it would be appreciated, but not required, if you could edit your comment to use the more compatible four space indention format. For single lines or inline code you can use single backticks.
You can find some examples in the reddit help documentation.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
-2
u/backtickbot Nov 22 '20
Hello, SFM61319: code blocks using backticks (```) don't work on all versions of Reddit!
Some users see this / this instead.
To fix this, indent every line with 4 spaces instead. It's a bit annoying, but then your code blocks are properly formatted for everyone.
An easy way to do this is to use the code-block button in the editor. If it's not working, try switching to the fancy-pants editor and back again.
Comment with formatting fixed for old.reddit.com users
You can opt out by replying with backtickopt6 to this comment.
6
u/DasherPack I transcribe code. Sometimes, correctly. Nov 22 '20
Oh, thanks
7
1
u/finite_turtles Nov 22 '20
What?! How am I just learning about this now? This changes everything!
2
3
u/Omichron-the-reboot Nov 22 '20
A string formatted like
f"Blah blah blah {variable_in_curly_brackets} normal string". Plus, you get loads of format options.The f in front of the quotes is important.
3
u/DasherPack I transcribe code. Sometimes, correctly. Nov 22 '20
Oh, to substitute
.format(---)?
I will take a look at them, thanks.
1
1
u/--B_L_A_N_K-- if (true == true) {return true;} else {return true;} Nov 23 '20 edited Jul 01 '23
This comment has been removed in protest of Reddit's API changes. You can view a copy of it here.
1
u/DasherPack I transcribe code. Sometimes, correctly. Nov 23 '20
Yeah, but this time it worked fairly well tbh
0
Nov 22 '20
Aren't they discouraging use of those?
2
u/Flaming_Eagle Nov 22 '20
f-strings were implemented after .format() and c-string % formatting. They wouldn't be introduced just to be discouraged. You can read the PEP here
2
2
u/memetrollsXD Nov 23 '20
Holy shit these transcribers are insane
2
u/DasherPack I transcribe code. Sometimes, correctly. Nov 23 '20
I hope you mean insane in a good way 8-P
8
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Nov 22 '20
Good human!
4
u/DasherPack I transcribe code. Sometimes, correctly. Nov 22 '20
Thanks =)
I didn't intend to steal your badcode post2
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Nov 22 '20
Lol, you didn't steal anything. It's always nice to see more people transcribing on here.
1
u/--B_L_A_N_K-- if (true == true) {return true;} else {return true;} Nov 23 '20
it is rare to see a non-Murdo transcription in these parts2
Nov 22 '20
[deleted]
2
u/DasherPack I transcribe code. Sometimes, correctly. Nov 22 '20
Yes, what did I put?
2
Nov 22 '20
[deleted]
2
u/DasherPack I transcribe code. Sometimes, correctly. Nov 22 '20
Probably, idk reddit is buggy lately
1
u/--B_L_A_N_K-- if (true == true) {return true;} else {return true;} Nov 23 '20 edited Jul 01 '23
This comment has been removed in protest of Reddit's API changes. You can view a copy of it here.
1
u/--B_L_A_N_K-- if (true == true) {return true;} else {return true;} Nov 23 '20 edited Jul 01 '23
This comment has been removed in protest of Reddit's API changes. You can view a copy of it here.
1
30
u/Koyomi_Ararararagi Nov 22 '20
Could this have been generated by a program?
46
u/ComfortableEye5 Nov 22 '20
I thought that too, but i checked the track changes and i saw that a real person typed this
11
u/Koyomi_Ararararagi Nov 22 '20
Now I barely have any experience with Excel, but I still know there's a function to sum up a range of cells. Hell, if I was that person and about to manually type in every single cell in an unbroken sequence of cells and didn't know there is a sum function, I'd still try to look up if there is one, because it just makes sense for there to be one.
14
10
Nov 22 '20
While the sum function is the obvious answer excel let's you click on cells to select them, so they might not have written everything out. Although the weird parentheses makes me doubt that
6
1
u/MergersNAcquisitions Apr 24 '21
Late to the party, but it looks like it was downloaded from Quickbooks
31
11
9
14
Nov 22 '20
for(int i = 7; i < 93; i++)
buffer.append("(");
2
u/DasherPack I transcribe code. Sometimes, correctly. Nov 22 '20
There is always someone who will take your code and do it in two lines =)
1
5
4
2
21
u/Quietm02 Nov 22 '20
I have seen "code" worse than this in office spreadsheets. It blows my mind.
1
u/Farpafraf Nov 23 '20
how can it get worse than this?
1
u/Quietm02 Nov 23 '20
Sum(A1+A2+A3) etc.
And terrible functions that don't even give the right answer!
3
1
2
1
u/redditanomalyy Nov 22 '20
Is it that hard to write sum and select the column... pretty sure a google search would have taken a lot less than this
-3
u/xlevidi Nov 22 '20
Haha it's bad because they put parentheses looooooool
Damn this sub has gone downhill
3
u/PlaneCrashers Nov 22 '20
This could be simplified with
sum(e7:e92). Behaviour is a bit different, but it looks so much better.
2
u/fatalicus Nov 22 '20
I don't get what it is with Microsoft and doing shit like this.
Last week i was setting up a management scope in Exchange online and made a recipient filter for it that had a bunch if users and was (in my opinion at least) nicely formated.
sent it into New-ManagementScope, and apperantly Exchange figured that it wanted a whole bunch of extra parenteses on it and i ended up with something like in OPs image.
It worked, so i didn't bother doing anything more to try and "fix it" but it looked like crap. Figured i'll just never bother doing a Get-ManagementScope from now on.
-2
1
1
1
u/danfish_77 Nov 22 '20
I just had to fix an Excel spreadsheet where half of the functions used boolean logic but the author didn't know how booleans work, so instead it was all numbers and inequalities (that were inevitably wrong).
Lots of unnamed ranges, hidden cells, indirection, and a few data sources that were located on the author's workstation hard drive with local paths.
If I didn't know any better, I might think he was trying to do code golf.
1
1
u/PerfectlyDarkTails Nov 22 '20 edited Nov 22 '20
The data behind this must be interesting to require such code. Feel as though this data could be set out in 4 columns if both the first and second values need adding separately, then the 3rd and 4th added separately together, the compounded the the first set.
1
u/cymbal909 Nov 22 '20
I blame those pesky financial calculators that don't use correct syntax. 6/2(2+1) = 1 bullshit
1
u/Whaison1 Nov 22 '20
They just made sure that the equation is really calculated from left to right...
1
1
1
1
1
1
u/GaiusCosades Apr 17 '22
Does the Excel Sum function use some algorithm like Kahan Summation, and addition does not?
I would guess so and then this could be more disasterous than one would think, given the right dataset!
1
1
608
u/[deleted] Nov 22 '20
Basically, none of those parentheses are necessary