Engineering With Excel Chapter 1
Engineering With Excel Chapter 1
Before you get started, I want to quickly explain what you can expect from this book.
as a hands-on resource.
follow along with so that you can really learn the concepts and commit them to
memory.
Along with your purchase of this book, you also received over 80 spreadsheets. These
spreadsheets are used throughout the book as examples that you can follow.
At the beginning of most sections is a reference to the spreadsheet used in that section.
Open the file and follow along with the steps described in that section.
Later, if you need to come back and refresh your memory on a concept, you can always
quickly brush up on a particular section.
lling!
Section 6: Using LINEST for Logarithmic, Exponential, and Power Curve Fitting ..........160
Scroll down until you find the square root function (SQRT). When you click it, a dialog
box will open. This box includes an explanation of the function and the arguments it
takes:
Select the number that you want to use in your calculation and click OK.
Another way to search for functions is using the Insert Function button next to the
formula bar (fx on the right):
When you click the fx button, you can enter a search term. After you find the correct
function, click OK, and it will bring you to the same dialogue box as above. Select the
cell that you want to use in the calculation and click OK.
However, these methods involve lots of clicking and dialogue boxes, so they become a
hindrance to productivity. Learning to type functions in will help increase your speed.
To use the square root function, click within a cell and type the equals sign, then start
typing the name of the function. As soon as you start typing, Excel suggests a list of
functions that start with that letter. As you type it narrows down the list. Simply typing
sq will narrow it down to two choices:
A short description of the function appears as a tool tip. You can use the Up and Down
Arrow keys to navigate within the list. Press the Tab key to choose a function, and it will
Below the cell, a tooltip box appears to lead you through the arguments that the
function takes. This is helpful for complex functions that have multiple arguments. Of
one argument (number in the tool tip). To add the argument, you can navigate to the
number 4 using the arrow keys (Up Arrow in this case), or just click its cell
unnecessary to add the closing parenthesis. Just hit Enter.
Entering functions by typing is the fastest way to work with functions. This method will
be used throughout the remainder of this book.
Inevitably, you will often reference other cells in your calculations. There are two
different types of cell references in Excel: relative and absolute. This is an important
concept to understand for entering formulas in Excel.
Relative cell references will change when a formula is copied to another cell. Absolute
cell references will remain constant when a formula is copied to other cells.
As an example, see the simple table below. There are a series of values in column A. In
with a relative reference to cell A1. If you fill that formula
down (using the fill handle from Chapter 1, Section 7), the other cells in column B will
refer to the cell directly to their left, not cell A1:
An absolute reference would maintain the reference to cell A1 in all of the cells:
For a table such as this, an absolute reference might not make sense, but there are many
In Excel, absolute references are denoted using a dollar sign before the row and column
designators. A quick way to turn a relative reference into one that is absolute is to use
the F4 key to toggle. The first time you type F4, the reference will become a fixed cell
absolute reference, i.e. $A$1. This reference will always stay locked onto A1.
However, pressing F4 a second time will allow you to fix the row reference while
allowing the column to change (i.e. A$1). If you copy this reference, the column letter
will be able to change (to A, B, C, etc.) like a relative reference, but it will always
reference the first cell in the column.
Typing F4 a third time will fix the column reference but allow the row to change (i.e.
$A1).
This formula can be used to calculate the airflow from a reference fan speed, fan
diameter and airflow rate as the speed and fan diameter change. In Worksheet 01b, the
reference fan speed, fan diameter and airflow are in a smaller table above.
Enter the formula into the first cell in the large table: =C7*(B12/C5)*(C11/C6)^3 (see
next page). Excel uses relative cell references by default, so use those for now.
This will calculate the expected airflow if a similar fan of smaller diameter was run at a
lower speed. However, if you use the fill handle to fill this formula into the rest of the
table, there will be errors in all the other cells:
This is because the references have moved. Absolute references are required here.
The three references to the original fan (in the small table) should stay fixed on a single
cell. To do this, select the cell with the formula, click within the reference and type F4
once. Do this for the references to cells C5, C6, and C7. This will add dollar signs before
both the column letter and the row number, indicating that this reference will be
constant.
The n2 variable is the speed of the new fan. This should be allowed to vary, because we
have a number of speeds in the column on the left side of the table. For this reference, it
will be necessary to fix the column, but allow the row to vary. Click within the reference
to cell B12 and type F4 three times to obtain $B12.
The d2 variable (C11) is the diameter of the new fan, located in the row along the top of
the table. To lock onto this row and allow the column to vary, type F4 twice to obtain
C$11.
Fill this formula into the rest of the table by dragging the fill handle first to the right,
then down.
To verify that the cell references are correct, click within any cell then within the formula
bar. The reference cells will be highlighted with a colored box. Each cell should highlight
the corresponding fan diameter at the top of the table and the corresponding speed on
the left side.
This section will cover a few basic mathematical functions: sum, product, quotient, and
absolute value.
The SUM function will quickly add numbers together. We can manually add together
the cells using the formula bar (below left), but the SUM function is faster (below right).
Type =SUM( into the desired cell, select the cells to be added with the mouse and press
Enter.
The PRODUCT function works in a similar fashion. Rather than manually multiplying
each cell (below left), we can simply type =PRODUCT( and select the cells to be
multiplied.
The QUOTIENT function is not exactly the same as dividing. When you manually enter
in a formula to divide 5 by 2 using the forward slash /, Excel will return 2.5 by default.
When you use the QUOTIENT function, Excel returns the integer 2, dropping the
remainder. When using the QUOTIENT function, remember to separate the two input
cells with a comma (numerator,denominator).
The ABS function returns the absolute value function of a given cell. If the input value is
negative, it converts it to positive. If the input value is positive, it will be returned
unchanged.
radians
working with angles in degrees e inputting
those values into one of these functions. You can use the RADIANS function directly, or
you can use the formula:
above formula in the form: =PI()/180*A1. You can also insert that term directly into one
of the trig functions. For example, to take the sine of cell A1, enter =SIN(PI()/180*A1)
into the formula bar.
Worksheet 01d contains a spreadsheet to calculate the sine, cosine and tangent for 0 to
In the first row, type =SIN( and select the cell containing the angle (C5). Repeat for the
cosine =COS(C5) and tangent =TAN(C5). To fill the rest of the table, select all three
cells, hover over the fill handle and double-click.
The worksheet will automatically plot the data when you fill in the table. There are
undefined values in the tangent at and which appear as ######. You can delete
these to clean up the plot.
To calculate the angle in degrees, enter the following into the first cell: =DEGREES(C5).
Double-click the fill handle
degrees as inputs for the sine, cosine and tangent columns. Delete the data in these
three columns. In the sine column, enter in the formula: =SIN(RADIANS(B5)). The
function to convert B5 to radians is nested within the SIN function. You could also use
=SIN(PI()/180*B5) if you prefer to use the formula on the previous page.
Enter the formulas =ASIN(B5), =ACOS(B5) and =ATAN(B5) in the columns for sin-1,
cos-1 and tan-1, respectively. Select these three cells and double-click the fill handle to
fill the columns. These three functions will return angles in radians:
To display the angles in degrees, you can nest these functions inside of the DEGREES
function. Double-click the first cell in the sin-1 column to edit it, and change the formula
to =DEGREES(ASIN(B5)). Edit the cos-1 and tan-1 columns in the same way. Select the
three edited cells and double-click the fill handle. Now the data will be in degrees:
where is the engineering strain found in column B. Select the first cell in the true
strain column and enter the formula =LN(1+B5). Press Enter, select that cell and
double-click the fill handle to apply the formula to the rest of the column. This will
allow you to see how the true stress and strain compare to the engineering stress and
strain.
Logarithms come up often when dealing with sound measurements. For instance, a
logarithm is used to calculate the overall sound pressure from sound measurements at
individual frequencies. In Worksheet 01g, the A-weighted sound pressure level can be
calculated from measured sound levels using the equation:
First, have to calculate from the corrected sound value, Li, in column E.
Enter =10^(E4/10) in the first cell of column F. Select the first cell and double-click the
fill handle SUM function to get the sum of the values
=10*LOG(SUM(F4:F11)).
The LOG function assumes base ten unless you specify the base in a second argument,
i.e. LOG(8,2) will find .
Worksheet 01h contains an example using the exponential function. This function is
used often for decaying oscillations. The ratio of successive oscillation amplitudes can
be calculated if the damping ratio is known using the formula:
where x1 is the first oscillation amplitude, x2 is the second oscillation amplitude, and is
the damping ratio. Worksheet 01h contains the first oscillation amplitude in cell C4 and
the damping ratio in cell C5, so we can rearrange the equation to solve for the second
oscillation amplitude.
=C4/EXP((2*PI()*C5)/SQRT(1-C5^2)).
appreciate the complex number functions that are built into Excel. Excel has many
Function Description
COMPLEX Creates a complex number
IMAGINARY Extracts the imaginary coefficient from a complex
number
IMREAL Extracts the real coefficient from a complex
number
IMDIV Divides complex numbers
IMPRODUCT Multiplies complex numbers
IMSUB Subtracts complex numbers
IMSUM Adds complex numbers
You can browse through the other functions for complex numbers by going to
Formulas > More Functions > Engineering. Scroll down to find the functions that
You can also see
the Excel help for more information.
The COMPLEX function takes real and imaginary coefficients and creates a complex
number, either in x+yi or x+yj form. The syntax is as follows:
i and j in
double quotation marks in the suffix argument.
The IMAGINARY function can be used to find the imaginary part of an existing complex
number y in x+yi
the complex number. The IMREAL function will extract the real part of a complex
number (x).
You
symbols (+, -, etc). To to
use these special functions: IMDIV, IMPRODUCT, IMSUB and IMSUM.
First, enter in the specified voltage (45+10j) as a complex number. The real part of the
voltage is 45 this will be the first argument. The imaginary part is 10, the second
with current.
Therefore, the entry for voltage will be =COMPLEX(45,10, . Excel will display this as
45+10j. Do likewise for impedance: .
simply divide the two complex numbers with the / operator. Use the IMDIV function.
This function takes the numerator as its first argument, and the denominator as its
second. Therefore, to find the current, enter =IMDIV(C6,C7). Remember to separate the
two arguments with a comma, not a slash.
Function Description
INT Rounds down to the nearest integer
ROUND Rounds the number to a specified number
of digits
ROUNDUP Rounds a number up, away from zero
ROUNDDOWN Rounds a number down, toward zero
MROUND Rounds to the nearest multiple specified
The INT function has only one argument, the number to be rounded. This function
effectively rounds down to the nearest integer.
The ROUND function is a little more sophisticated. It uses the standard rules for
The
syntax is as follows:
ROUND(number, num_digits)
number: the number to be rounded
num_digits: the number of digits to round the number argument
For example, to round the number 3.14159 to two decimal places, enter in
=ROUND(3.14159,2).
There are two functions that allow you to control the direction of rounding. ROUNDUP
will always round up, away from zero; ROUNDDOWN will always round down, toward
zero. Both of these functions take the same arguments as ROUND above, so you can
choose the number of digits to round to.
MROUND(number, multiple)
number: the number to be rounded
multiple: the multiple to which the number will be rounded (i.e. 10, 5, 2, 0.25, etc.)
Worksheet 01k contains a flow calculation for a pipe with a known flowrate. The velocity
in the pipe cannot exceed 120 in/sec. Calculations have already been done to determine
the required diameter. However, pipe be available with a diameter of exactly 4.4
in, so we need round to the next available size.
We can use the INT function, but this function will round down to 4. To avoid exceeding
the desired velocity, simply add 1 to the pipe diameter. Enter =INT(C9)+1 into the first
cell for pipe diameter:
The ROUNDUP function will ensure that we round up. To round to a whole number,
enter 0 for the number of digits: =ROUNDUP(C9,0)
What if pipe is available in increments of half an inch? The MROUND function will allow
us to round to the nearest half inch. Use 0.5 for the multiple: =MROUND(C9,0.5)
One thing to note is that the ROUND function can be used to round to the tens place, hundreds
place, or any higher place. Simply use a negative number in the second argument for the tens
place, -1; for the hundreds place, -2; and so on. The magnitude of this number will be equal to
the number of zeroes in your final rounded number.
For example, try rounding the flow rate to the hundreds place. Choose a cell and enter
=ROUND(C7,-2). To round to the tens place, use -1 as the second argument. The ROUNDUP and
ROUNDDOWN functions work similarly: use a negative number as the second argument to
round to a place left of the decimal.
This section and the next will cover the advanced summing functions available in Excel.
The SUMIF and SUMIFS functions enable you to sum values in a range of cells if they
a are excluded from the sum.
The criterion can be a number, an expression, a function or a text string. SUMIF restricts
the data being summed according to a single criterion. SUMIFS allows you to specify
multiple criteria. The syntax is:
Worksheet 01m contains some measured stress data in column B as well as the number
of times the stress was at a certain level during the measurement period in column C.
We will use SUMIF to calculate the percent of time that the stress was above a certain
level. In order to do that, first calculate the percent of time represented by each
count in column C
=C6/SUM($C$6:$C$3) in cell D6. If you prefer, you can select the cells with the mouse
remember to type F4 after you select the range for all the counts to create an absolute
into the rest of the column. Select cell D6 and double-click the fill handle.
Now column D displays the percentage of time that this location was at each stress
SUMIF to calculate the percentage of time that the stress
was greater than certain amounts. Enter =SUMIF( in cell G6. The range to be evaluated
is in column B, so select that range (click the first cell and type Ctrl-Shift-Down Arrow),
then type F4 to make it an absolute reference.
=SUMIF($B$6:$B$32
Add a comma after the first argument. For the second argument, we have to build the
criterion &) to form a string joining together the
greater than symbol ( (F6).
Therefore, the second argument will be:
marks.
=SUMIF($B$6:$B$32,
Again, add a comma after the argument. Lastly, we need to select the data to be
summed the percent data in column D. Click cell D6, type Ctrl-Shift-Down Arrow,
followed by F4. Add a close parenthesis. Your formula should be:
This formula tells Excel to check if the value in column B is greater than the value in
column F, and if so sum the corresponding percentages from column D.
Type Enter, select the cell again, and double-click the fill handle. This is the resulting
table:
check the other values, you can highlight the cells in column D that are greater than
10,000. Excel will automatically display the sum of the highlighted cells in the lower left
border of the window:
The sum should match the value calculated by the SUMIF function.
Worksheet 01n contains the same data, but poses a different question: what percentage
add all the percentage values
between the two limits shown on the worksheet (6,000-20,000 psi), including the limits
solve use the SUMIFS function with two
criteria, one for the lower limit and one for the upper limit. In the previous problem, we
simply used the greater than (>) operator. In this example, we will include the limits in
You may have noticed that the SUMIFS function has a different order for its arguments.
The range to be summed comes first. Enter =SUMIFS( in cell K5. Select the percentage
data in column D.
The second argument is the range of the first criterion. In this case, the criterion will be
based on the stress data in column B. At this point your formula should be:
=SUMIFS(D7:D33,B7:B33,
The third argument, the first criterion, will be constructed similarly to the first example,
but instead of we will use & to
concatenate to the cell containing the lower limit, G5.
That completes our first criterion. We also need to add a criterion to limit the summed
values for stress levels less than 20,000 (cell G6). The SUMIFS function can take
additional criteria by adding arguments for the range and criterion. For this problem, the
range will be the same. The criterion will simply be , restricting the summed
values to only those with a stress less than or equal to G6.
=SUMIFS(D7:D33,B7:B33,
Again, you can quickly check that this formula summed only the values that fall within
the limits by highlighting the percentage values that correspond to stress between
6,000 and 20,000 psi. The value in the lower border should match:
You can adjust the limits in cells G5 and G6 and the SUMIFS function will update
accordingly.
SUMPRODUCT
and SUMSQ.
SUMPRODUCT(array1
array1: the first array whose components will be multiplied then added
array2, array 3, etc.: (optional) additional arrays whose components will be
multiplied
then added
The first argument, array1, is the only one that is required. If only one argument is
entered, the function will simply return the sum of the array components without doing
any multiplication. To fully utilize this function, enter multiple arrays (up to 255). The
function will multiply the individual array components and sum them.
SUMSQ returns the sum of squares of whatever numbers are entered as arguments. Its
syntax is:
SUMSQ(number
number1: first number for which the sum of squares is calculated
number2, number3, etc.: (optional) additional numbers for which the sum of
squares will be
calculated
Again, only one argument is required. In that case, the function will return the value of
that number squared. As you add additional values, they will be squared, and then
summed together to return a single value.
Worksheet 01o contains an example that uses both functions. The spreadsheet contains
XYZ coordinates for two vectors. We can calculate the angle between the vectors by
using the equation:
This equation uses the dot product of the vectors to calculate the angle. The
SUMPRODUCT function is essentially a dot product, so this function can be used to
calculate the numerator. Enter =SUMPRODUCT( into cell C11. Select the XYZ
coordinates for vector 1, then type a comma. Select the coordinates for vector 2. The
resulting formula is:
=SUMPRODUCT(C6:E6,C7:E7)
The denominator will be the product of the magnitude of the two vectors. To find the
magnitude, take the square root of the sum of squares of the vector components. Enter
in the formula:
=SQRT(SUMSQ(C6:E6))*SQRT(SUMSQ(C7:E7))
Finally, to calculate the angle in degrees, use the inverse cosine function, ACOS,
inputting the numerator and denominator that was just calculated. To get the angle in
degrees, nest the ACOS function inside of the DEGREES function:
=DEGREES(ACOS(C11/C12))
Excel has many statistical functions. To see the complete list, go to Formulas > More
Functions > Statistical. This section will cover some of the basic statistical functions.
Function Description
AVERAGE Finds the average or the mean
of a set
MEDIAN Finds the median of a set
MODE Finds the mode of a set
STDEV Finds the standard deviation of a
set
MAX Finds the maximum value in a
set
MIN Finds the minimum value in a
set
The first one we will calculate is the mean. In Excel, the function for the mean is
AVERAGE. Enter that function, select the first cell of data, and type Ctrl-Shift-Down
Arrow. This will give you the formula =AVERAGE(B4:B103).
For the remaining cells, do likewise, using the functions in the table above.
The CONCATENATE function is used to combine text data. It can connect multiple
words or phrases into one longer phrase. There are two ways to use this function.
CONCATENATE can be used as a regular function. Input two or more arguments, and it
will connect them together. The arguments can be a text value, a number, or a cell
reference. Note that if you are using Excel 2016, you may use CONCAT instead; it works
the same way.
C5,
While the CONCATENATE function can combine text, Excel has other functions that can
separate
the previous section into two sentences.
The LEFT function extracts a certain number of characters of text starting from the left
side. This function takes two arguments: the cell containing text, and the number of
characters to extract.
Enter in the formula: =LEFT(C4,9). This will return the first 9 characters of the string in
cell C4.
RIGHT. The syntax is the same as LEFT, except that it counts the number of characters
starting from the right side of the string. In this case, the second sentence is 16
characters, so the formula will be: =RIGHT(C4,16).
The second sentence can also be extracted using the MID function. MID can return text
from the middle of a string, but in this case, get the entire second
sentence. The syntax of the MID function is slightly different, because you need to
specify a starting position. In this example, the first character to be extracted is the 11 th
=MID(C4,11,16)
Excel has logical functions to help your spreadsheets make decisions. The most common
logical function is the IF function. This function can be used to return a result that is
dependent on whether an argument is true or false. The syntax is as follows:
Worksheet 01r contains a simple calculation of tensile stress due to an axial force in a
round shaft. The safety factor is then calculated based on the yield strength of the
material. An IF function can be used to display a string based on the safety factor in cell
C12. If the value is greater than 2, the IF function will return a text string that says the
The first argument, logical_test, will be: C12>2. This is the argument that will be tested
the value_if_true
argument; if C12 is less than 2, it will return the value_if_false argument. The function will
begin with: =IF(C12>2
With the default values in the spreadsheet, the safety factor is 7.3, so this function will
increasing the force to 100,000 N, the safety factor will drop below the threshold, and
Note the IF function can be used for outputs other than text strings. You can use it to
return a number, do a calculation, or perform a function.