Chhaya Wagmi

Calculating Cell Values with Formulas

• Dec 28, 2019
• 129 Views
• Dec 28, 2019
• 129 Views
Microsoft Excel

Introduction

In this guide, you will learn how to calculate cell values using various functions in Microsoft Excel 2019.

Excel formulas allow users to perform calculations on large amounts of data in a very short time and simplified manner. For an example, what if a teacher wants to calculate the average grade scored by thousands of students in a subject? It would take him hours to calculate the average using a calculator, but through Excel, a simple drag of cells containing grades and a simple formula can do the work in a few seconds. Excel formulas play an important role in the lives of students, auditors, business professionals, an many others.

There are various functions present in the Excel 2019 version to calculate cell values:

• SUM
• PRODUCT
• AVERAGE
• COUNT & COUNTA
• IF
• MAX & MIN
• TRIM
• DEC2BIN

Let's walk through each of these functions.

SUM Function

The `SUM` function is used to add values. It can be used to add individual values, cell references or ranges, or a mix of all three.

The `SUM` function has the following syntax:

``````1
````=SUM( number1, [number2], ... )````

The arguments used in the function are the numbers that need to be added. As mentioned above, arguments can be individual values, cell references or ranges. To illustrate this, let's consider the example given below:

ABCDEFG
Sr. NumberValue1Value2Value3Value4FormulaResult
110353213423=SUM(B1:E1)?
21222551321=SUM(B2, C2, D2, E2)?
388501512=SUM(88, 50, 15, 12)?
4625717343=SUM(B4, D4)?
515511187=SUM(B2:E2, B5:E5)?

The result column will be updated as given below:

ABCDEFG
Sr. NumberValue1Value2Value3Value4FormulaResult
110353213423=SUM(B1:E1)3600
21222551321=SUM(B2, C2, D2, E2)519
388501512=SUM(88, 50, 15, 12)165
4625717343=SUM(B4, D4)79
515511187=SUM(B2:E2, B5:E5)683

PRODUCT Function

The `PRODUCT` function multiplies all the numbers given as arguments and returns the product.

The `PRODUCT` function has the following syntax:

``````1
````=PRODUCT(number1, [number2], ...)````

The arguments used in the function are the numbers that need to be multiplied. The `PRODUCT` function is useful when you need to multiply many cells together. To illustrate this, let's consider the example given below:

ABCDEFG
Sr. NumberValue1Value2Value3Value4FormulaResult
1133213=PRODUCT(B1:E1)?
2222531=PRODUCT(B2:E2, 3)?
385052=8 50 5 * 2?
467173=PRODUCT(C4, E4)?
5155118=PRODUCT(B2:E2, B5:E5)?

The result column will be updated as given below:

ABCDEFG
Sr. NumberValue1Value2Value3Value4FormulaResult
1133213=PRODUCT(B1:E1)2457
2222531=PRODUCT(B2:E2, 3)20460
385052=8 50 5 * 24000
467173=PRODUCT(C4, E4)21
5155118=PRODUCT(B2:E2, B5:E5)45012000

AVERAGE Function

The `AVERAGE` function returns the average (arithmetic mean) of the arguments.

The `AVERAGE` function has the following syntax:

``````1
````=AVERAGE(number1, [number2], ...)````

Arguments present in the function can be numbers or names, ranges, or cell references that contain numbers. To illustrate this, let's consider the example given below:

ABCDEFG
Sr. NumberValue1Value2Value3Value4FormulaResult
1133213=AVERAGE(B1:E1)?
2222531=AVERAGE(B2:E2, 3)?
367173=PRODUCT(C3:E3)?
4155118=PRODUCT(B2:B4)?

The result column will be updated as given below:

ABCDEFG
Sr. NumberValue1Value2Value3Value4FormulaResult
1133213=AVERAGE(B1:E1)10
2222531=AVERAGE(B2:E2, 3)12.6
367173=PRODUCT(C3:E3)9
4155118=PRODUCT(B2:B4)14

COUNT & COUNTA Function

The `COUNT` function is used to get the number of entries in a number field that is in a range or array of numbers, whereas the `COUNTA` function counts the number of cells that are not empty in a range.

The `COUNT` function has the following syntax:

``````1
````=COUNT(value1, [value2], ...)````

The `COUNTA` function has the following syntax:

``````1
````=COUNTA(value1, [value2], ...)````

Let's consider the example given below to understand the use of `COUNT` and `COUNTA` functions better:

ABCDEFG
Sr. NumberValue1Value2Value3Value4FormulaResult
1133213=COUNT(B1:E1)?
2222531=COUNTA(B2:E2)?
367NAME=COUNT(B3:E3)?
4TOM511=PRODUCT(B4:E4)?

The result column will be updated as given below:

ABCDEFG
Sr. NumberValue1Value2Value3Value4FormulaResult
1133213=COUNT(B1:E1)4
2222531=COUNTA(B2:E2)4
367NAME=COUNT(B3:E3)2
4TOM511=COUNTA(B4:E4)3

IF Function

The `IF` function allows you to make a logical comparison between a value and what you expect by testing for a condition and returning a result if that condition is TRUE or FALSE.

The `IF` function has the following syntax:

``````1
````=IF(logical_test, [value_if_true], [value_if_false])````

The `logical_test` argument used in the function is any value or expression that can be evaluated to TRUE or FALSE. Let's consider the example given below to understand this function:

ABCDEFG
Sr. NumberValue1Value2Value3Value4FormulaResult
1133213=IF(B1 > D1, C1, FALSE)?
2222531=IF(NOT(B2 = E2), TRUE, FALSE)?
385052=IF(B3 > 20, C1, D1)?
467173=IF(C4 = E4, TRUE, FALSE)?

The result column will be updated as given below:

ABCDEFG
Sr. NumberValue1Value2Value3Value4FormulaResult
1133213=IF(B1 > D1, C1, FALSE)FALSE
2222531=IF(NOT(B2 = E2), TRUE, FALSE)TRUE
385052=IF(B3 > 20, C1, D1)5
467173=IF(C4 = E4, TRUE, FALSE)FALSE

MAX & MIN Function

The `MAX` function is used to return the largest value in a set of values, whereas the `MIN` function returns the smallest number in a set of values.

The `MAX` function has the following syntax:

``````1
````=MAX(number1, [number2], ...)````

The `MIN` function has the following syntax:

``````1
````=MIN(number1, [number2], ...)````

Let's consider the example given below to understand the use of both of the functions:

ABCDEFG
Sr. NumberValue1Value2Value3Value4FormulaResult
1133213=MAX(B1:E1)?
2222531=MIN(B1:B4)?
367173=MAX(B1:E4)?
4155118=MIN(B1:E4)?

The result column will be updated as given below:

ABCDEFG
Sr. NumberValue1Value2Value3Value4FormulaResult
1133213=MAX(B1:E1)21
2222531=MIN(B1:B4)6
367173=MAX(B1:E4)31
4155118=MIN(B1:E4)2

TRIM Function

The `TRIM` function removes all spaces from text except for single spaces between words.

The `TRIM` function has the following syntax:

``````1
````=TRIM(text)````

The `TRIM` function can be used on text that you have received from another application that may have irregular spacing. Let's consider the example given below to understand the functionality better:

ABCD
Sr. NumberTEXTFORMULARESULT
1APPLE=TRIM(" APPLE ")?
2I AM A DOCTOR=TRIM(" I AM A DOCTOR ")?

The result column will be updated as given below:

ABCD
Sr. NumberTEXTFORMULARESULT
1APPLE=TRIM(" APPLE ")"APPLE"
2I AM A DOCTOR=TRIM(" I AM A DOCTOR ")"I AM A DOCTOR"

DEC2BIN Function

The `DEC2BIN` function is used to convert a decimal number to binary.

The `DEC2BIN` function has the following syntax:

``````1
````=DEC2BIN(number, [places])````

We can convert a Decimal number To Binary/Octal/Hex With formulas or vice versa with a slight modification to the formula. Let's consider an example below to illustrate this:

ABCDE
Sr. NumberDECIMALBINARYHEXOCTAL
14=DEC2BIN(B1)=DEC2HEX(B1)=DEC2OCT(B1)
2120=DEC2BIN(B2)=DEC2HEX(B2)=DEC2OCT(B2)
2356=DEC2BIN(B3)=DEC2HEX(B3)=DEC2OCT(B3)

After applying the formula, the result will be updated as shown below:

ABCDE
Sr. NumberDECIMALBINARYHEXOCTAL
1410044
2120111100017078
2356101100100544164

Similarly, we can now convert Binary to Decimal/Octal/Hex, Hex to Decimal/Octal/Binary and Octal to Decimal/Binary/Hex.

Binary to Decimal/Octal/Hex

You can use the syntax below to convert Binary to Decimal:

``````1
````=BIN2DEC(number, [places])````

Syntax for Binary to Octal:

``````1
````=BIN2OCT(number, [places])````

Syntax for Binary to Hex:

``````1
````=BIN2HEX(number, [places])````

Hex to Decimal/Octal/Binary

You can use the syntax below to convert Hex to Decimal:

``````1
````=HEX2DEC(number, [places])````

Syntax for Hex to Octal:

``````1
````=HEX2OCT(number, [places])````

Syntax for Hex to Binary:

``````1
````=HEX2BIN(number, [places])````

Octal to Decimal/Binary/Hex

You can use the syntax below to convert Octal to Decimal:

``````1
````=OCT2DEC(number, [places])````

Syntax for Octal to Binary:

``````1
````=OCT2BIN(number, [places])````

Syntax for Octal to Hex:

``````1
````=OCT2HEX(number, [places])````

Conclusion

In this guide, you have learned a few of the formulas that calculate cell values, but there are hundreds more Excel formulas you can explore in Excel to make your work a lot easier. You may also like to look at the following guides on Excel topics:

0