How to use Excel formulas | Windmill Testing Framework

Your manager has entrusted you with a task that he has defined as rather simple: you have to process data in a spreadsheet using Microsoft Excel in order to get the required results. Unfortunately, however, although you know how to use some basic Excel features, you have never used formulas: a tool that is now indispensable for you to do your work and, therefore, you are wondering how to use Excel formulas.

I bet that’s exactly how it is, isn’t it? Then you don’t have to worry in any way, because I have all the answers you’re looking for. In this guide, in fact, I’m going to show you how to use Excel formulas to perform calculations on the data in your spreadsheet. First of all, in order to make you understand what we are going to do, I will explain what a formula is and what its elements are.

What’s that? Can’t wait to start reading the tips I’ve prepared for you? So what are you waiting for? Come on: sit down nice and comfy and take a few minutes of your free time, so that you can carefully read the information that I will provide you with in the next chapters and learn, you too, how to compile a formula on Excel. Are you ready? Are you? Very well! All that remains is to wish you a good read and, above all, good work!

What is an Excel formula
Excel formula

Microsoft Excel is a software that allows, through the use of a spreadsheet, to manage data and carry out calculations, which are done through the use of formulas.

An Excel formula is – to put it simply – a string through which you declare the calculation you want to perform on the data in your possession. It consists of several elements that are, in general, recurring.

To help you understand this topic, I propose as an example the formula =SE(A1>0; “Positive”; “Negative) which consists of the function SE(), a reference (A1), a constant (0) and several operators (for example, the sign >). All these elements are almost always present in the formulas, although in some cases there may be exceptions, depending on the calculation to be performed.

To better understand how an Excel formula works, in the next chapters I’ll explain in detail what the different elements I mentioned earlier are and how they are used.

Functions

Often, a formula is confused with a function. As I already explained to you in the previous chapter, a formula is a statement made by the user to perform a calculation. A function, on the other hand, is a code already defined in Microsoft Excel that allows you to perform a specific operation.

Going back to the example I gave you in the previous chapter, the SE() function is not a formula, as it simply expresses a concept: to obtain a true or false result, based on a given condition. As soon as it is transcribed inside a cell, with the sign = and all the other arguments, we obtain a formula based on the SE() function.

Functions can be used individually within a formula or concatenated together, creating more complex formulas, through which a calculation is declared that could never be done with a single function.

In Microsoft Excel there are many functions available that cover different areas of calculation: those that concern financial subjects, statistics, trigonometry or logic, just to give you some examples.

Functions can be called inside a cell, by first typing the = sign and then indicating their declaration parameter: in the case of the SE() function, you must type SE: by doing so, a tooltip will be shown under the cell (i.e. a hint), which will give you the indications for the correct compilation of the function.

If you don’t know what function to use, in Excel for Windows and macOS you can call it up using the Insert Function button on the Formulas tab. If, on the other hand, you use Excel Online, you can call the same panel using the Function button on the Insert tab.

As for, finally, the Excel app for Android or iOS, you can add a formula using the drop-down menu at the bottom, selecting the Formulas item (on smartphones), or via the appropriate tab at the top (on tablets).

Operators
Excel formula operators

Any formula used in Microsoft Excel requires the use of operators: these are nothing more than symbols that define a specific operation in the calculation, according to the category to which they belong.

Even the simplest formula =A1, written in cell B1 of the spreadsheet, is composed of the operator =. The = operator is indispensable for writing a formula and starting the calculation linked to it.

Among the operators that you can use within a formula, there are those of comparison, such as the sign = which, in addition to what has already been said in the previous lines, is also used to declare that two values must be equal. Then there are the signs > and < which express respectively if a value must be greater or less than another. The latter signs, combined with the = operator, express that a value must be greater than or equal to (or less than or equal to) another. There are also other operators used to define intervals between cells, such as the sign : (colon) or to group arguments, such as round brackets. Another operator which is often present in a function is the one expressed with the sign ; (the semicolon), which allows to separate the arguments of a function from each other. References Excel formula references

After defining functions and operators, another recurrent element in a formula is the reference: the latter has a similar function to the variable in a mathematical formula. References are, in fact, expressed with cell links.

Taking the formula =LENGTH(A1) as an example, the term A1 represents a cell reference that can contain any user-defined value. It does not, therefore, have to be a numeric or textual value typed into the cell by you, but can also be the result of a calculation performed in the cell itself.

References can be expressed by a single cell (A1) or by a range (A1:A100) defined by the operator with the sign : (the colon), which I told you about in the previous chapter. A formula that contains a cell reference will vary the result of its calculation, according to the data entered in the cell itself.

When formulas are repeated in other cells, through the drag-and-drop operation, the cell reference changes in its form: if in cell B1 you wrote a formula that contains a reference to cell A1, dragging it to the cell below (B2) will automatically change the reference to A2. In this case, there is a line change in the cell reference. This also happens when the formula repetition occurs horizontally, which results in a column change in the cell reference.

In certain formulas, the operation described above can cause calculation errors, since some references must remain anchored to a cell, without any change occurring during the row or column translation. In this case, you have to use the $ operator inside the reference, as I explain in the next lines.

The $A1 reference indicates that, with the repetition of the formula, the column should remain locked, allowing the rows to change.

The reference A$1 indicates that, with the repetition of the formula, the row should remain locked, allowing the columns to change.

The $A$1 reference indicates that, with the repetition of the formula, both the column and row of the cell should remain locked, so that the cell reference in the formula is left anchored.

In addition to what was said in the previous lines, a reference can also consist of a name. Names are references that contain user-defined data, such as a cell range, a function, a constant or a table. Names can be set by the user through the Formulas tab and by selecting the Manage Names button.

Constants
Excel formula

Finally, the last elements that can be useful to you in a formula are constants. A constant is nothing more than a user-defined value that is not variable. A constant is, therefore, disconnected from the concept of a cell, as it must be a non-changing piece of data.

The constant can be either a numeric value or a textual value, depending on the calculation you need to perform. Take, for example, the formula =SE(A1>0; “Positive”; “Negative). The value 0 represents a constant for the cell reference A1. This cannot be changed, since all values in cell A1 are required to be positive numbers.

The next arguments of the SE() function are also constants: the terms Positive and Negative are the truth conditions that the formula will have to express, according to the declared condition. These constants are non-mutable, since they have been specified by the user.

These truthfulness conditions in the formula can also be replaced by other functions, thus making the value dynamic and susceptible to change, based on the cell references in them. I will explain this concept better in a later chapter of the tutorial.

Fill in an Excel formula
Excel formula analysis

Now that you’re aware of all the elements you may need in a formula, it’s time to see how to fill one out.

Let’s take as an example a formula that aims to verify if the tax code belongs to a female or a male person.

Leave a Reply

Your email address will not be published. Required fields are marked *