Тёмный

Say Goodbye to IF Statements in Excel with SWITCH 

Teacher's Tech
Подписаться 951 тыс.
Просмотров 430 тыс.
50% 1

This tutorial will show how to use the SWITCH function in Microsoft Excel. We start by exploring the basics of the IF function, a staple in Excel's formula arsenal, to ensure a solid foundation. Then, we introduce the SWITCH function - a lesser-known yet incredibly potent tool in Excel. We'll compare these two functions side-by-side, illustrating how SWITCH can provide cleaner, more readable formulas, especially in scenarios with multiple conditions.
Key highlights of this video include:
A comprehensive overview of IF and SWITCH functions.
Practical examples demonstrating the advantages of SWITCH over nested IF statements.
Step-by-step guidance on how to implement the SWITCH function in real-world scenarios.
Tips for enhancing formula efficiency and readability in your Excel projects.
By the end of this tutorial, you'll be well-equipped to make the switch (pun intended!) from cumbersome IF statements to the elegant simplicity of the SWITCH function. Whether you're managing data, analyzing reports, or love to streamline your Excel workflows, this video is your gateway to next-level Excel proficiency.
See why XLOOKUP is Superior to SWITCH: • Why XLOOKUP Reigns Sup...
Practice File: go.teachers.tech/SWITCH_FUNCTION
Timestamps:
0:00 Introduction
0:20 Replacing a Nested IF statement with SWITCH
3:21 Using an Operation with the SWITCH function
5:30 Using an IF statement with a nested SWITCH function

Опубликовано:

 

11 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 435   
@Gorman-84
@Gorman-84 2 месяца назад
I am the master of nested IF statements. You have ruined my life. Just kidding. This is great. I cannot wait to replace all of my nested IFs. Thank you.
@AlThePal78
@AlThePal78 Месяц назад
you can use =IFS() as well so they don't have to be nested and it looks more like this switch statement
@NickCombs
@NickCombs 29 дней назад
If statements are still needed in any situation where you test different data points. Cases where you have just one value to test are actually not as common as you'd think outside of simple demos.
@highestbuilding
@highestbuilding 4 месяца назад
I didn't know about this function. But after watching your video, I still prefer using tables with the xlookup-function to keep things as variable as possible.
@jmacdono
@jmacdono 4 месяца назад
How can you use XLOOKUP to insert values based on criteria in other cells? SWITCH has a different function it seems to me.
@davescrams
@davescrams 4 месяца назад
@@jmacdono You create a table with values that correspond to the translation. Consider the second example. You could create a separate table with a column for region and another column for the associated commission percentage. In the original table, you use xlookup to lookup the region and return the commission percentage. This approach is much easier to manage if the number of categories is large or likely to change.
@c17nav
@c17nav 4 месяца назад
@@jmacdono Microsoft's web site help is a great resource for all of Excel's functions. Heaven help you should buy one of the many books available.
@jakubklima9002
@jakubklima9002 4 месяца назад
Exactly what I tought while watching the video.
@ramilaquino5350
@ramilaquino5350 4 месяца назад
based on experience, i could say the same, using a table and xlookup is better as it is dynamic. works same way as a join in SQL, and it handles missing results much better.
@RichardJJennings
@RichardJJennings 2 месяца назад
At 1:30 I realised this is the DECODE function in SQL. Super handy and I no longer need to do those awful nested IFs. Thank you
@nathanh9935
@nathanh9935 4 месяца назад
I always did a vlookup function with a table to change a number to a rating. Also, I find that it is still pretty clean to use 2 digits concat in another table to change a double input into a single output. The formulas are clean that way too. Still, I'm glad to know the switch function exists.
@jyotikumarrout7323
@jyotikumarrout7323 4 месяца назад
Wow, this tutorial on using the SWITCH() function is incredibly helpful! I've always struggled with nested IF statements, but this alternative seems much more efficient and organized. Thanks for breaking it down step by step and providing clear examples. Can't wait to start implementing this in my own projects!
@eng.halmatmuslih4714
@eng.halmatmuslih4714 4 месяца назад
True “IF” is not handy in this situation, but you can use”IFS” function, same results and neat as much as switch. Thanks for the explanation, another function is added to the line, helpful.
@alexk7467
@alexk7467 3 месяца назад
That's true, but the only problem with "IFS" is you must have a value which is true. So if any value doesn't match any in the "IFS" statement the statement will fail.
@sql638
@sql638 3 месяца назад
@@alexk7467You can insert as last condition a ever-true one, so a condition without any restriction, simply ……;TRUE”;”Value you desire”). So if all the previous conditions fail, this one will apply
@agwosdz1981
@agwosdz1981 2 месяца назад
For that, you can encapsulate the function with IFNA or IFERROR :)@@alexk7467
@TheJaswald
@TheJaswald 2 месяца назад
@@alexk7467 You can set the final test value to "TRUE()" then the result: =IFS(test1, result1, test2, result2, ..., TRUE(), result_n)
@yelnatsch517
@yelnatsch517 Месяц назад
@@alexk7467the very last statement in the IFS could just be 1 then set the default value. Example: ifs(case1, “A”, case2, “B”, case3, “C”, 1,””). If all cases fail, the default will be “”.
@firozmakrani
@firozmakrani 4 месяца назад
Using excel for decades but today I learned about switch. Thanks ❤
@donniemcgee7523
@donniemcgee7523 4 месяца назад
This is an extremely helpful tutorial. Thank you so much for sharing it. You did a great job of laying out and explaining the material. Thank you, again!
@anacom4238
@anacom4238 4 месяца назад
You explain things very well and it's easy for me to learn from your videos despite my adhd. Thank you!
@TeachersTech
@TeachersTech 4 месяца назад
You’re welcome!
@garciarogerio6327
@garciarogerio6327 Месяц назад
I use SWITCH it in Power Bi. I normally use IFS to avoid nested if statement. Great one!
@Pattythomas5
@Pattythomas5 3 месяца назад
I have not heard of the switch function...THAT was excellent! Thank you!
@colinubeh1180
@colinubeh1180 3 месяца назад
Hey! this is simpler than nested if function. THANK YOU!
@marklutz5837
@marklutz5837 4 месяца назад
Recently retired, worked with Excel for years and didn't know about switch. Looks very handy, can think of many times I would have chosen that instead of the clumsy "if" statements. Thanks.
@TeachersTech
@TeachersTech 4 месяца назад
I’m glad you found it useful!
@tomjones1502
@tomjones1502 4 месяца назад
SWITCH is a new function not find in older version of excell
@anggaraw
@anggaraw 3 месяца назад
​@@tomjones1502 This function only in 365 right?
@tomjones1502
@tomjones1502 3 месяца назад
No, SWITCH function was added in year 2016, in excel 365
@tomjones1502
@tomjones1502 3 месяца назад
Switch function is in Excel 2019 and 365 (not sure but 2021)
@terjidjurhuus1917
@terjidjurhuus1917 4 месяца назад
I use Switch in PowerShell all the time, but funnily it never occurred to me that it exists in Excel. Really useful, thanks!
@infamous8541
@infamous8541 4 месяца назад
switch is also available in many other programming languages
@RemofRenaissance
@RemofRenaissance 4 месяца назад
Thanks for this, I like the structure of the formula (more so than “IF” as simpler for those nested functions as you’ve also highlighted). As others have said I prefer reference tables and lookups for most instances but I will definitely use the “SWITCH” formula as have many use cases like dynamic formulas to work out year to date values. Great to learn something new 👍🏾
@daonguyen521
@daonguyen521 4 месяца назад
Very helpful teacher. This is the 1st time I know about this function
@tomcoleman8702
@tomcoleman8702 4 месяца назад
Thank you RU-vid algo! I actually can use this Monday at work... completely useful and relevant. Very nice examples!
@TeachersTech
@TeachersTech 4 месяца назад
Great to hear! Thanks!
@Pronellyllon
@Pronellyllon 4 месяца назад
Thank you for this video. While I am known as the Excel genius at my work, I wasn't aware of the Switch function. I am sure I'll be able to have a lot of fun with this function in the future
@rlsbdog
@rlsbdog 4 месяца назад
It's easier, quicker and more dynamic to use vlookup (or xookup) or index/match to a reference table. For "No Rated", you can wrap your function in an IFERROR.
@Pronellyllon
@Pronellyllon 4 месяца назад
@@rlsbdog I don't think they have the exact same purpose. The lookups and index/match functions are referring to a singular cell. In one of my Excel-tables, I have a sumifs function in which I would want it to select another column based on the value of another cell. In this case, I think the switch function fits better.
@danguee1
@danguee1 Месяц назад
@@Pronellyllon switch function is inflexible and undynamic
@Pronellyllon
@Pronellyllon Месяц назад
@@danguee1 it worked pretty well for me. In a situation where I used the IFS-function and continuously referred to the same cell had a specific value then needed to pick up a specific column in a table, I used the SWITCH-function instead. Now I didn't need to refer to the same cell anymore. Everything else in that formula stayed the same
@Akulion1
@Akulion1 Месяц назад
Wow what a time saver! Truly good by nested IFs lol thanks for sharing!!
@troelstrc
@troelstrc 4 месяца назад
Thank you for this - I understand that this video is about the function switch. But for efficiency and future adjustments, I would put all the values into 1 or 2 tables and use the strengths of xlookup to return the desired results, instead of hardcoding it into a formula.
@TeachersTech
@TeachersTech 4 месяца назад
I would agree that.
@Ian-gf8id
@Ian-gf8id 4 месяца назад
@troelstrc Exactly. In this example a simple table of corresponding data (Performance Score / Performance Rating) can be used for multiple purposes including the source for Data Validation List (i.e. the Performance Rating cell range as a drop-down menu) and in one's preferred Lookup formula. Hard-coded data in formulae can be very restrictive, and make back-tracing errors and amendments very difficult. I avoid hard-coded data in formulae wherever possible.
@athar786100
@athar786100 4 месяца назад
Great examples! I had never heard of switch.
@Bhavik_Khatri
@Bhavik_Khatri 4 месяца назад
Avoid using a switch statement, try using if statement with a VLOOKUP or XLOOKUP already provides the values. Refrain from hard-coding in the formula, etc.
@DjMikeWatt
@DjMikeWatt 4 месяца назад
Why?
@JeffUmscheid
@JeffUmscheid 4 месяца назад
Because your values might change, and instead of changing a bunch of formulas, you change the lookup table once. For example, if Excellent changed to Outstanding, just update the reference table instead of all the formulas. You can also add IFNA at the beginning for a value that’s not found, a la “Not Rated”
@DjMikeWatt
@DjMikeWatt 4 месяца назад
@@JeffUmscheid I've got a lot yet to learn.
@hex-2748
@hex-2748 4 месяца назад
Dynamic ✅
@laurencesyeng6182
@laurencesyeng6182 2 месяца назад
You don't have to hard-coded the value. You can use name ranges for both the region values and commission values, to a certain degree of dynamic when using SWITCH(). This is an example with the commission values in named range. SWITCH(E1,"NORTH",C_NORTH,"SOUTH",C_SOUTH,"EAST",C_EAST,"WEST",C_WEST,C_DEFAULT)*D1
@goingvenus5603
@goingvenus5603 4 месяца назад
Very interesting and well-presented. Thanks!
@amystiksma1116
@amystiksma1116 4 месяца назад
This was amazingly useful! I have so many nested ifs in a budget spreadsheet, and it makes it so hard anytime I need to change things. Usong switch instead is going to make it so much easier! Thanks so much!
@TeachersTech
@TeachersTech 4 месяца назад
You're so welcome!
@wahas2752
@wahas2752 4 месяца назад
Thank You. This will make my sheets so less complicated now.
@shadeburst
@shadeburst 2 месяца назад
Happy days! This is the honorable descendant of the CASE statement in good old FoxPro. Well done MS!
@DB-nl9xw
@DB-nl9xw 4 месяца назад
thank you for sharing the knowledge
@PlantBasedPietro
@PlantBasedPietro 4 месяца назад
Never heard of the Switch function. Thank you Jaime!!! :)
@TeachersTech
@TeachersTech 4 месяца назад
You're welcome!
@prabhakarrao4922
@prabhakarrao4922 2 месяца назад
Brilliant - Thanks for sharing. Really appreciate your work. Kind Regards
@robertdufour2456
@robertdufour2456 4 месяца назад
Thank you for all of your help through the years!
@TeachersTech
@TeachersTech 4 месяца назад
You're very welcome!
@leovanhorrik9526
@leovanhorrik9526 4 месяца назад
Thank you very much. I didn't know about this formula but will definitely use it in the future.
@TeachersTech
@TeachersTech 4 месяца назад
Glad it was helpful!
@goodgollywally
@goodgollywally Месяц назад
Thank you so much. I loved it.
@sparacin
@sparacin 2 месяца назад
Excellent. I already have a couple of work cases that can benefit from this SWITCH function!
@stuartbrown3859
@stuartbrown3859 2 месяца назад
Awesome Tutorial, so much easier.
@fssacko
@fssacko Месяц назад
Great thank you lot Mrs Teacher's Tech
@philipperiondel3093
@philipperiondel3093 4 месяца назад
Actually, it is the equivalent of Select case in VBA. Thanks a lot, I did not know this function existed in Excel. It would have saved me a lot of time if I had known it sooner.
@leandratel2466
@leandratel2466 4 месяца назад
SWITCH is nice, but I'm more a fan of IFS. Nice video ❤🙏🏽
@alexrosen8762
@alexrosen8762 4 месяца назад
Extremely well explained and perfect real life examples
@nerissawood73
@nerissawood73 15 дней назад
I had never heard of this function and will definetly use it from now on. I regularly miss brackets or put them in the wrong spot doing long clustered IF functions. And can see the ease of modifying a statement if you need to add more options later on. Tx for sharing!
@angelgeorge7629
@angelgeorge7629 4 месяца назад
This is AWESOME!!!! Was able to simplify so so soooooo many IF statements in a spreadsheet I am working on.
@TeachersTech
@TeachersTech 4 месяца назад
Glad it was helpful!
@larrywill464
@larrywill464 2 месяца назад
Great function! Thanks a lot, I didn't know about this
@scottgardner7318
@scottgardner7318 4 месяца назад
I have not seen this function. Brilliant! TY
@liquidapathy82
@liquidapathy82 4 месяца назад
Absolutely excellent info. I want to try it on some spreadsheets that have some complex nested if statements
@lawon01
@lawon01 Месяц назад
This helped alot thank you!!!
@wv1138
@wv1138 2 месяца назад
Never used switch. Liked and subscribed. Good input.
@pandharinathjoshi6565
@pandharinathjoshi6565 4 месяца назад
Very neat explanation sir💐🙏
@warriorlink8612
@warriorlink8612 Месяц назад
Thanks for the demo. I can see some scenarios where this could help.
@caiopjv
@caiopjv 4 месяца назад
Excelent and very useful! Thanks
@robertsamagalsky1617
@robertsamagalsky1617 25 дней назад
Love the new SWITCH function!
@silviopoggi8193
@silviopoggi8193 4 месяца назад
So very helpful! Excellent presentation regarding a function I never heard of...
@TeachersTech
@TeachersTech 4 месяца назад
Glad it was helpful!
@power-reconcile
@power-reconcile 25 дней назад
Well explained! Thanks for sharing!
@johnbufton1487
@johnbufton1487 Месяц назад
Excellent, I shall using it. Thanks!
@davethorpe5947
@davethorpe5947 4 месяца назад
Very useful! Thanks!
@WiFiJeremy
@WiFiJeremy 2 месяца назад
Pretty cool. I didn't know about this one.
@ARIES9327
@ARIES9327 2 месяца назад
ahhh saved so much time ! amazing!
@apoorvasgala
@apoorvasgala 3 месяца назад
Hi ! Nice video. Very informative about Switch function. Honestly speaking I didn't knew about this until now. Thanks for sharing knowledge. I read many comments below about usability of this function and suggestions about instead use xlookup, index match and other various function. They may be right in their opinion as xlookup, index are very powerfull. BUT, this tutorial is about Switch function and not about finding alternatives to if function or switch function. See, when these powerfull functions were not available we used to use if function very largely. But now with advancements in MS Excel we get so many new functions with mind blowing capability. It may so happen that one day there would be better function available then xlookup! Who knows. So I would stick to commenting on Switch function and its usability, quality of the video, quality of content of video like language and graphics used, explanation done, example shown and discussed rather then speaking of alternative to switch function. Overall very interesting and informative video.
@albertokusmic9239
@albertokusmic9239 4 месяца назад
great, did not know about it, thanks for sharing!
@Xevailo
@Xevailo 2 месяца назад
Note for all german users: apperantly, in the german Version of Excel, this function is intuitively called "ERSTERWERT"
@Matsobane-tc6ii
@Matsobane-tc6ii Месяц назад
Excellent formula to save time
@rchsuccesspartnersllc155
@rchsuccesspartnersllc155 2 месяца назад
Nice- I didn't know... Thanks
@richardslater677
@richardslater677 4 месяца назад
Interesting and useful
@raylachman8101
@raylachman8101 3 месяца назад
thank you sir ‼️👍
@gichai
@gichai 12 дней назад
Good job
@MrHackmed
@MrHackmed 4 месяца назад
This is excellent
@splendid1963
@splendid1963 4 месяца назад
👍excellent. Very useful. Thanks
@Srinivasan.Answers
@Srinivasan.Answers 3 месяца назад
useful information
@x4ms
@x4ms 3 месяца назад
Thank you!
@yousefabdelsamie5983
@yousefabdelsamie5983 3 месяца назад
Perfect, thank you
@HeroZaki_
@HeroZaki_ 4 месяца назад
I just heard about it now. Thanks🌹
@ExcelTutorials1
@ExcelTutorials1 4 месяца назад
I love the SWITCH function!!! =)
@cesarrodrigues9763
@cesarrodrigues9763 2 месяца назад
Very useful...
@aceofdatabase
@aceofdatabase 4 месяца назад
Knew of switch functions generally... Had no idea it was in Excel. How handy.
@Pankaj-Verma-
@Pankaj-Verma- 3 месяца назад
It's good, thanks.
@alexanderbenson1602
@alexanderbenson1602 7 дней назад
Love it!
@rudycramer225
@rudycramer225 4 месяца назад
Nice function. I can use this. Will save a lot of hassles.
@user-fq1nj9sb4e
@user-fq1nj9sb4e 3 месяца назад
This is great
@rameshhariharan2623
@rameshhariharan2623 3 месяца назад
Sir this is great
@stuartc6303
@stuartc6303 4 месяца назад
Never heard of it before tbh. Looks useful.
@JoeLoffredo
@JoeLoffredo 2 месяца назад
I use CHOOSE for similar situations, but this is useful too.
@jasonjackson4555
@jasonjackson4555 4 месяца назад
I love switch(). I told my analyst to try it a year ago and he cleaned up some complex sheets with it.
@TeachersTech
@TeachersTech 4 месяца назад
That's awesome!
@DoeBlapoh-gh1mk
@DoeBlapoh-gh1mk 11 часов назад
So great.
@rajeshmajumdar4999
@rajeshmajumdar4999 4 месяца назад
Thanks!
@artnace
@artnace 4 месяца назад
Never heard of it but will try it.
@nobodynobody1235
@nobodynobody1235 3 месяца назад
With the nested if like this, using a reference lookup table is ideal. When I use if statement, I mostly use it as argument so the formula will do a different calc
@bijaytanty8434
@bijaytanty8434 4 месяца назад
Thanks 👍🏻
@vishal80
@vishal80 29 дней назад
Thank you 😊
@StanEby1
@StanEby1 2 месяца назад
Love it.
@justdontJD
@justdontJD Месяц назад
I create so many complicated spreads with very long IF statements, the switch function is going to cut my work in half. Thank you for sharing.
@phandongexcel
@phandongexcel 3 месяца назад
I like this video ❤❤❤❤❤❤❤
@md.moslehuddinuddin4077
@md.moslehuddinuddin4077 4 месяца назад
It's excellent! thank you. From Dhaka, Bangladesh, Md. Mosleh Uddin
@MrMarcusjames
@MrMarcusjames 4 месяца назад
outstanding
@michaelpostell4053
@michaelpostell4053 4 месяца назад
Never heard of this. Thanks for letting us know. (And for your other tips on other posts).
@TeachersTech
@TeachersTech 4 месяца назад
So glad you found useful! Your welcome.
@sachinbizboy
@sachinbizboy 4 месяца назад
Thanks.
@arturoforondaii1
@arturoforondaii1 3 месяца назад
Thanks
@zkimyong
@zkimyong 4 месяца назад
I did not know this before!
@magma2050
@magma2050 Месяц назад
That's very handy. I've neither used nor heard of this function, but I will likely make good use of it this week. There are a few fringe cases where I suspect it's no better (e.g., to simulate the output of a decision tree by examining TRUE/FALSE statements in multiple cells, which I think would require as many nested SWITCH functions as nested IF functions to achieve), and as others have said, larger lists are best queried using lookup functions, but this will tidy up smaller lists in my future spreadsheet work significantly.
@Daltonpat
@Daltonpat 4 месяца назад
Like most reactions i would probably use xlookup and a table. I do see an advantage when you are using numbers and letters when searching. I will test the speed of switch vs xlookup on a large number of records. Thanks for the video!
@dougmphilly
@dougmphilly 4 месяца назад
subscribed.
@carlosmiguel9733
@carlosmiguel9733 2 месяца назад
Em português essa função é chamada de PARÂMETRO. Excelente!
@herumuharman6305
@herumuharman6305 17 дней назад
A streamlined version of IFS function, nice.
Далее
Excel Battle: CHOOSE vs SWITCH
11:00
Просмотров 16 тыс.
5 Excel Secrets You'll Be Embarrassed You Didn't Know
17:32
DELETE TOXICITY = 5 LEGENDARY STARR DROPS!
02:20
Просмотров 13 млн
10 Excel Formulas That Will Set You Apart (Cheat Sheet)
18:04
Try This New Formula Instead of Pivot Tables
12:08
Просмотров 155 тыс.
SWITCH Function in Power Query
10:24
Просмотров 26 тыс.
Excel LAMBDA - HOW & WHEN you Should use it
16:02
Просмотров 424 тыс.
This ~NEW~ Excel Function is Shockingly Powerful!
9:37
Data Modeling for Power BI [Full Course] 📊
2:34:41
Просмотров 3,1 млн