| IT2000:FIGURES | USING =IF FORMULAE | |||||||||||||||||||||||||||||||||
| A common task you might want to do is
get your computer to take some data you’ve entered, get some corresponding
information and use that for a calculation or another display.
A simple example would be to check whether a price was OK or expensive. In plain English: if the price is greater than 15.99, it’s expensive, otherwise it’s OK. This can be written as a formula in an Excel spreadsheet and it follows the structure of the sentence above: =IF(price>15.99,"it's expensive","OK") The structure is this:
IF expressions can be really useful and can get very long and complicated if you want. Here’s the IF expression which will give different grades, depending on marks in an exam.
The IF expression is: =IF(Mark>89,"A",IF(Mark>79,"B",IF(Mark>69,"C",IF(Mark>59,"D","E")))) This is called a nested IF formula. Note that you just need one = at the start, to open a bracket after each IF and then to close them all at the end. Looks odd but it works.
|
||||||||||||||||||||||||||||||||||
| © Andrew Hill, Milton Keynes, UK MMVI | ||||||||||||||||||||||||||||||||||