The February 2016 release of Office 365 introduces four new functions. This video deals with the new SWITCH function.
Transcript of the video:
Learn Excel from MrExcel podcast, episode 1965 - The SWITCH Function!
Hey, welcome back to the MrExcel netcast, I'm Bill Jelen.
Well, the last new function they gave us, in the February 2016 release of Office 365, is a function called SWITCH!
Alright, and check this out, so the way that it works, you know, here we have a value of 2, and we're asking for the SWITCH of that 2, and then we give it pairs, for value 1 we want to return Sunday, for value 2 we want to return Monday, for value 3 we want to return Tuesday.
Now, a bad example here, we could have just used the CHOOSE function to do this, but let's say that we have some other values.
Alright?
And then finally, at the end, what to do if nothing matches.
So no match.
Now, if you leave that last argument off, the value of "No match", and it's not found!
Right, so if we ask for like an 8 here, and we're going to get an #N/A error because there's nothing there.
So always add that last argument unless you want the #N/A. Alright, so here in this case when it's not found, it returns "Not found".
OK, so, now, why is SWITCH better than CHOOSE?
Well because you don't have to put all the values!
So here we're specifying what to do if it's a 1, what to do if it's a 7, we didn't have to specify 2 3 4 5 6, so I can see where that would be useful.
So if it's a 1, it's a Sunday 7's a Saturday, otherwise all the other days, they just get "weekday".
Alright, so anything that you put in here, the 'not found' will cause it to say "weekday".
You put in a 1, or you in a 7, it'll understand that it is a weekend.
Alright, so the SWITCH function, the fourth new function that they introduced here in Office 365, and again, you HAVE to have the latest version of Office 365, or be using Excel online, or be using a mobile version of Excel.
You need one of those if you have Excel for Business, it's possible they haven't upgraded you to this release yet, unless you're in the First Release program.
So, it's coming, if you just own straight, boxed version of Office 2016, or Excel 2016, these will not be coming to you until the next perpetual release of Excel, you know, a year or two from now.
Hey I want to thank you for stopping by, we'll see you next time for another netcast from MrExcel!
Hey, welcome back to the MrExcel netcast, I'm Bill Jelen.
Well, the last new function they gave us, in the February 2016 release of Office 365, is a function called SWITCH!
Alright, and check this out, so the way that it works, you know, here we have a value of 2, and we're asking for the SWITCH of that 2, and then we give it pairs, for value 1 we want to return Sunday, for value 2 we want to return Monday, for value 3 we want to return Tuesday.
Now, a bad example here, we could have just used the CHOOSE function to do this, but let's say that we have some other values.
Alright?
And then finally, at the end, what to do if nothing matches.
So no match.
Now, if you leave that last argument off, the value of "No match", and it's not found!
Right, so if we ask for like an 8 here, and we're going to get an #N/A error because there's nothing there.
So always add that last argument unless you want the #N/A. Alright, so here in this case when it's not found, it returns "Not found".
OK, so, now, why is SWITCH better than CHOOSE?
Well because you don't have to put all the values!
So here we're specifying what to do if it's a 1, what to do if it's a 7, we didn't have to specify 2 3 4 5 6, so I can see where that would be useful.
So if it's a 1, it's a Sunday 7's a Saturday, otherwise all the other days, they just get "weekday".
Alright, so anything that you put in here, the 'not found' will cause it to say "weekday".
You put in a 1, or you in a 7, it'll understand that it is a weekend.
Alright, so the SWITCH function, the fourth new function that they introduced here in Office 365, and again, you HAVE to have the latest version of Office 365, or be using Excel online, or be using a mobile version of Excel.
You need one of those if you have Excel for Business, it's possible they haven't upgraded you to this release yet, unless you're in the First Release program.
So, it's coming, if you just own straight, boxed version of Office 2016, or Excel 2016, these will not be coming to you until the next perpetual release of Excel, you know, a year or two from now.
Hey I want to thank you for stopping by, we'll see you next time for another netcast from MrExcel!