3 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

All You Need Is SWITCH

I don't think I've seen this discussed before, so I apologize if I am rehashing old material. I did a cursory search and found nothing.

For a decade now, I've argued you should always use COUNT/SUM/MAX/MINIFS instead of COUNTIF because you never know when you'll need additional conditions. In present times, we don't even need COUNTIFS/RACON functions because you can do the same thing with array formulas although COUNTIFS is easier to type, IMO.

So when a week or two ago I learned you can do the same thing as IFS with SWITCH. This got me to thinking... based on the COUNTIFS principle I'm whimsically calling "the condition of sufficient conditions is always conditional"... I'm thinking the meta is to always use SWITCH instead of IF or IFS. This would be a very hard habit to form as I've used more IF statements than Diddy used bottles of baby oil, but let's be aspirational.

https://preview.redd.it/n530f9gwzx0h1.png?width=888&format=png&auto=webp&s=1b63482b3d9562bb0dfaa80fc05851beeecc819b

Now, the SWITCH version of your basic Hot Dog/Not Hot Dog IF is I think the same amount keystrokes (with tab completion), so I'm calling that a win. I'll grant that the IFS version of multiple logical operators is more "straightforward" or even "intuitive" if you're reading an online tutorial on multi-conditionals, but if you want one function-ring to rule them all and in the darkness gut em like a fish, then ALL YOU NEED IS SWITCH.

=SWITCH(A1,"Hot Dog","Hot Dog","Not Hot Dog") =IF(A1="Hot Dog","Hot Dog","Not Hot Dog") 

Now, being a rational being, let's consider the downsides.

  • Backwards Compatibility / No One Understands What The Hell You Are Doing
    • Backwards compatibility needs are typically a foreseeable binary so... whatever, my condolences if you don't get to live in 365 function utopia.
    • If you need other people to understand what you are doing this may be a bad habit to form.
  • File Size Bloat Cuz You've Become A SWITCHaholic
    • You keep adding conditions and dragging down formulas because you've committed to an absolutist and universalist vision of SWITCH as the one true function and forgot that after 3 conditions for sure you should just make a lookup table and only store the reference data once.

Anyways, interested to hear anyone else's thoughts even if you just tell me this is the ramblings of a mad man.

Edit for posterity:

Additional Significant Downside(s)

submitted by /u/Downtown-Economics26
[link] [comments]

Want to read more?

Check out the full article on the original site

View original article

Tagged with

#Excel alternatives for data analysis
#Excel compatibility
#generative AI for data analysis
#financial modeling with spreadsheets
#rows.com
#natural language processing for spreadsheets
#Excel alternatives
#big data management in spreadsheets
#conversational data analysis
#cloud-based spreadsheet applications
#real-time data collaboration
#intelligent data visualization
#no-code spreadsheet solutions
#data visualization tools
#enterprise data management
#big data performance
#data analysis tools
#data cleaning solutions
#SWITCH
#COUNTIF