Sample Formulas that use operatpors - MS-Excel Tutorial
Sample Formulas that use operatpors
These examples of formulas use various operators:
- The following formula joins (concatenates) the two literal text strongs to produce a new text strong: Part-23A:
="Part="&"23A" - The next formula concatenates the contents of A1 with cell A2:
=A1&A2
Usually, concatenation is used with text, but concatenation works with values as well. Forma example, if cell A1 contains 123 and cell A2 contains 456 the preceding formula would return the values 123456. Note, that technically, the result is a test string. However, this text string functions as a numeric value. - The following formula uses the exponentiation operator to raise 6 to the third power, to produce a result of 216.
=6^3 - A more useful form of the above formula uses a cell reference instead of the literal value. Note this example that raises the value in cell A1 to the third power:
=A1^3 - This formula returns the cube root of 216 (which is 6):
216^(1/3) - The next formula returns TRUE in the value in cell A1 is less than the value in cell A2. Otherwise, it returns FALSE.
A1<A2
Logical comparison operators also work with text. If A1 contains Alpha and A2 contains Gamma, the formula returns TRUE because Alpha comes before Gamme in alphabetical order. - The following formula return TRUE if the value in cell A1 is less than or equal to the value in cell A2. Otherwise, it returns FALSE.
=A1<=A2 - The next formula returns TRUE if the value in cell A1 does not equal the value in cell A2. Otherwise, it returns FALSE.
=A1<>A2 - Unlike some other spreadsheets (such as 1-2-3), excel doesn't have logical AND or OR operators. Rather, you use functiosn to specify these types of logical operators. For example, this formula returns TRUE if cell A2 contains either 100 or 1000:
=OR(A1=100.A1=1000)
Thi lest formula returns TRUE only if both cell A1 and cell A2 contain values less than 100:
=AND(A1<100,A2<100)