Member-only story
I am currently studying a Business Statistics and Analysis course on Youtube that utilises Excel as the platform that it will use to carry out any statistical analysis. One piece of programming code that was brought up is the nested IF statement, which in my opinion, is similar to a CASE statement. Excel has a sWITCH statement that is said to be a type of CASE statement, but I looked at it and it does not perform like a proper CASE statement that I was accustomed to working with close to four decades ago when I was studying Basic (which is no longer in use, except for Visual Basic, I believe).
In order to demonstrate how to use a nested If statement as a CASE statement, I have created a small program in Excel, which can be seen below. This worksheet is an educational spreadsheet where the student id, score, and grade assigned are calculated:-
The first thing that I did was to assign the student ids. In cell A2 I entered the number 1. In cell A2 I entered the formula
=A2+1.
I then copied and pasted the formula down to cell A31, which is the total number of students in the class:-