Beruflich Dokumente
Kultur Dokumente
Previous posts (e.g. Stress blocks in AS 3600) have presented Excel User Defined Functions
(UDFs) that determine the ultimate bending strength of a reinforced concrete section with the
use of a rectangular concrete stress block, with depth and stress factors adjusted so that the
results are identical to those using a parabolic-rectangular block, such as that defined in
Eurocode 2. This post provides details of this procedure, including VBA code for a UDF to
calculate the required factors for any specified concrete strength.
The figure below (from Eurocode 2) illustrates how a non-linear stress-strain curve may be
approximated by a rectangular stress block, applied over part of the area in compression.
If the stress block is being used with a rectangular cross section it is possible to calculate
values for the depth and stress such that the area under the block, and the lever arm from the
neutral axis, are exactly equal to that for any specified curvilinear stress-strain relationship.
Parabolic and Equivalent Rectangular Blocks
The procedure for calculating the rectangular stress block equivalent to the Eurocode 2
parabolic/rectangular block is shown below :
Equivalent Rectangular Stress Block Procedure
This procedure can be simply coded in a VBA function (to use the function in your own
spreadsheet, copy and paste the code into any VBA module):
Enter as an array function to return the full array (see here for details of using array
functions).
Share this:
The previous post in this series looked at how specified shrinkage and creep strains affect the
curvature of a reinforced consrete section subject to a constant load. In this post I will
present a User Defined Function (UDF) that analyses the curvature due to loading, prestress,
creep and shrinkage over a series of time steps, allowing the interaction between these factors
to be taken into account, and also allowing for variation in loading and the concrete stiffness
over time.
The UDF has been added to RC design functions6.zip. As usual, the spreadsheet includes
full open sourec code.
The procedure used is:
Read the section properties, creep and shrinkage parameters for each time step, and
optionally load, prestress and concrete E value for each time step.
For each time step:
Adjust the applied loads, prestress, and concrete E value, if required.
Adjust the concrete E value for the increase in creep from the previous step.
Calculate a virtual prestress force equivalent to the total shrinkage and creep strain up
the the previous step, plus the shrinkage strain for the current step.
Calculate the section strains and curvature for the current step.
Update the virtual prestress to include the creep increment from the current step.
Go to next time step.
The screenshot below shows typical input data and results from the TimeCurve function
compared with a time-step analysis carried out in the finite element analysis program
Strand7.
This screenshot shows typical time-step data and results. Note that the UDF must be entered
as an array function (press ctrl-shift-enter) to view all the results.:
Click to view full size
The previous post in this series provided Excel User Defined Functions (UDFs) to find the
strain in a concrete section due to unrestrained creep and shrinkage. In this post the effect of
restraint of the creep and shrinkage strains by the section reinforcing steel will be discussed,
and in the following post a UDF will be presented that allows the stresses and strains in the
section to be calculated allowing for creep and shrinkage strains and variation in the applied
load and prestress over time.
Both shrinkage and creep result in a shrinkage strain in the concrete, with no change in stress
for an unrestrained section, but for a reinforced section the reinforcement partially restrains
the concrete strain, resulting in a transfer of compressive stress from the concrete to the
reinforcement for zones in compression, or an increase in the tensile stress in the concrete for
uncracked zones in tension.
A simple way to visualise the effect of shrinkage on the strains and stresses in a reinforced
section is to apply an imaginary external compressive axial force to the reinforcement, so that
it follows the unrestrained shrinkage strain of the concrete, with no change to the concrete
stress. If the external force is then removed the state of stress and strain in the section will be
the same as for a section that has undergone shrinkage with no change to the external loads
(except for the effects of creep, which will be discussed later). This analysis is illustrated
below:
Before Shrinkage
Note that:
For an uncracked section with symmetrical reinforcement the shrinkage strain does
not affect the curvature of the section.
For a cracked section there is a significant change in curvature due to shrinkage
strains, even for symmetrical reinforcement.
The restraint of the shrinkage strain causes a significant increase in the tensile stress
in the concrete, which results in a reduction of the cracking moment.
The effect of shrinkage may be analysed by applying a compressive prestress to the
reinforcement, equal to the free concrete strain multiplied by the reinforcement elastic
modulus.
The change in stress in the concrete due to shrinkage is reduced by the effects of
creep. Analysis of this effect is discussed below.
Creep is the increase over time of strain due to applied load. Creep typically increases the
strain in the concrete by a factor of the order of 3, and must therefore be considered in
assessment of the long term behaviour of concrete structures. The reinforcing steel is also
subject to creep strains, but at typical reinforcement stresses the effects are negligible (except
for prestressed reinforcement, where the relaxation of prestress due to creep must be
considered). Since shrinkage results in a change of stress in the concrete, this interacts with
creep effects.
The effect of creep strains could in principle be analysed in the same way as shrinkage, by the
application of a virtual prestress to the reinforcement, but since the magnitude of the creep
strain is proportional to the stress in the concrete, the magnitude of the virtual prestress is
dependent on the stress in the concrete after completion of creep, so an iterative procedure
would be required to find the correct level of prestress. A simpler approach is to use an “age
adjusted modulus” for the concrete, so that the analysed strain in the concrete includes both
elastic and creep strains. For a creep coefficient of Ø the age adjusted modulus is given by Et
/ (1+ Ø), where Et is the elastic modulus of the concrete at the time of loading.
Having found the concrete stresses after creep using the age adjusted modulus method, it is
possible to find the equivalent virtual prestress that will result in the same stresses and
curvature in the section. The virtual prestress for creep is given by Es ec Ø / (1+ Ø), where Es
is the elastic modulus of the reinforcing steel, and ec is the total strain in the concrete at the
level of the reinforcement, as determined by the age adjusted modulus method. This prestress
is then applied in conjunction with the unreduced concrete modulus, giving exactly the same
end results for stresses in the concrete and reinforcement, and strains in the reinforcement.
Examples of these methods of calculating creep strains are shown below:
Age adjusted modulus method; click to view full size
Virtual Prestress Method; click to view full size
To combine creep and shrinkage effects, a simple method that is satisfactory for many
purposes is to use the age adjusted modulus method for creep, and the virtual prestress
method for shrinkage. Whilst this method will usually give a result within the order of
accuracy of standard materials properties, it does introduce several avoidable inaccuracies:
It does not take account of the variation of creep stresses over time.
It does not take account of the interaction between shrinkage stresses and creep
strains.
If shrinkage results in the section transitioning from an uncracked to a cracked state at
some time after initial loading, the initial stress and strain conditions will be very
different to those assumed, and this may introduce significant inaccuracies.
If the loading and/or prestress applied to the section changes significantly over time it
is not possible to take account of these changes in the simple analysis.
All of these factors can be included in a time step analysis as described below:
1. Set up a table of logarithmic time steps, with shrinkage strain and creep factor for
each time step. Optionally add changes to applied loads, and changes to prestress
loads.
2. Analyse the strains and stresses in the section at the end of the first time step, using
the virtual prestress method for shrinkage and the age adjusted modulus method for
creep.
3. For each succeeding time step add creep strains from the previous stages to the
cumulative shrinkage strain for calculation of the virtual prestress. Find the creep
strain increment using the age adjusted modulus, using the increment in the Ø value,
and adjust applied loads and applied prestress where applicable.
A spreadsheet performing this analysis, with examples based on real projects, will be
included in the next post in this series.
Share this:
https://newtonexcelbach.com/tag/eurocode-2/
I decided to add more some more functionality to my Application Settings addin. In fact, I
also changed the name to Excel Settings. (It's actually a different file, so please be sure to
click "Check settings when opening/saving files" on the menu if you want these to fire).
What's new? As you can see, I added 2 new sections for Workbook Scope and Worksheet
Scope settings. The picture pretty well speaks for itself.
And, if your file is saved (has a path), you can see File Size, Last Saved (Date and Time) and
Last Edit (Author) details.
Application.Iteration
Application.MaxIterations
Application.MaxChange
In the case of the last 2 settings, you'll notice that there are Set, Reset and Save buttons. This
is how they work,
The problem, as I see it, is not switching it back to xlCalculationAutomatic. Given that some
people for whatever reasons might use Manual Calculation all the time, most people don't,
especially the vast majority of average users who probably haven't heard of this setting. With
Calculation still set to Manual, they might be looking at values that haven't be updated. Even
experienced programmers might be temporarily confused until they figure out what's going
on. Imagine someone in a sales department quoting incorrect pricing to a customer or doing a
faulty presentation at an important meeting. Not good.
And now for what really worries me - saving files with this setting. Let's try something. Close
all Excel files, except one to use for testing. Now switch to Manual Calculation. If you don't
know how to do it in code, you can click Calculation Options on the Formulas tab, then select
Manual. Now save in that setting, close Excel, and reopen the file. If that file is the first one
to be opened, Excel Calculation will be set to Manual by default, and all other files opened
thereafter will be affected too. Save any of them with this setting, and the same thing will
happen if they happen to be the first file opened...
So, how do you know Calculation is set to Manual without specifically checking?
You can't.
Now, imagine sending one of these files to colleagues or customers, then realizing something
is amiss days later. Again, not good. In fact, downright scary.
So, also in 2005(?), I made an addin called Calculation Checker. It checks Calculation when
you save and prompts you to do so as Automatic if set as otherwise (including Automatic
Except for Data Tables).
I've found it useful, but since then I've thought there's room for improvement, so I made
something new.
As you can see there's 3 menu items. The bottom 2, when toggle to "On", check files when
opened/saved for the following settings.
Application.DisplayFormulaBar
Application.DisplayStatusBar
Application.Calculation
Application.ReferenceStyle
If any of those settings are not at their default, the Application Settings form will be
displayed. Non-default settings are displayed in red. (Yes, the first 3 should be obvious, but
easy enough to miss if you're busy, tired or both!)
Click the form's controls to reset them individually, or just click the Reset Everything button,
then the Save File and Exit button if you choose to. Alternatively, click the X button not to
save the file. Note that any other file that are open will also be saved with these settings
(unless you change them later), because they are Application settings, not Workbook settings.
And because the form can be opened directly from the Ribbon, you can easily change any of
the settings at any time for whatever reason. Click the Show Settings button and you can see
other settings that can also be reset when clicking the Reset Everything button, if the Include
other settings checkbox is ticked.
Note
Keep in mind that these additional settings aren't checked automatically. The form only resets
them if you click the Reset Everything button as mentioned above. Also, if
Application.EnableEvents is set to False by VBA code, my addin won't check files when
opening or saving as these are the events that trigger it. In fact, you should be setting this
False if any of your code does open or save workbooks to prevent my code from running,
then set it back to True before the code ends.
At a former client, I was asked to submit monthly reports that show details of work
performed in 15 minute increments.
"Let's see, a monthly calendar, something like the one on my fridge door comes to mind and
making one in Excel should be easy..."
One problem is space. If I do several tasks in one day, do I use tiny font to make the details
fit, or do I make the calendar larger to the point that I have to scroll copiously?
Also, just how practical is that style of calendar going to be when it comes to adding up total
time per task? Something along the lines of a regular timesheet would be better.
I can easily fit 32 rows on my laptop screen. That's a good start. So here's how to do the same
thing I did, if you are interested.
Leave the first row for your headers. In cells A1 and B1, enter "Date" and "Day", then change
the orientation. Right click the cells, select Format Cells, Alignment, and change Orientation
to 90 degrees.
(You might want to change the Alignment too. Choose from the options on the Alignment
Group on the Home Tab)
Enter the first day of the month in cell A2. Select range A2:A32, then change the format to
either "d/m" or "m/d" as you prefer. Right click the cells, select Format Cells, Number, and
enter the format in the Type text box in the Custom section.
Now enter =A2+1 into Range A3:A32 and click your Ctrl and Enter keys simultaneously to
enter the formula into all selected cells.
Adjust the width of both of these columns and set the alignment to suit.
Start times allotted for the 15 minute intervals go in Row 1. Adjust the Orientation to 90
degrees. "h:mm" is a suitable format.
The task descriptions that match the numbers can go on the right. But note the numbers to
their left to perform a lookup.
Important: adjust the following ranges to suit your requirements. Use Named Ranges if you
prefer.
Enter formulas to add up the time. Type the following formula into Cell AI2, and drag down
to the end of your list.
=IF(COUNTIF($C$2:$AE$32,AG2)=0,"",COUNTIF($C$2:$AE$32,AG2)/4)
You should have something like this.
You can freeze the first row if the number of tasks exceed the number of visible rows on your
screen. (View Tab, Windows Group, Freeze Panes, Freeze Top Row)
Now for some extra features to enhance visibility. Why not add some Conditional Formatting
to highlight the weekends? With Range A2:AE32 selected, click the Home Tab, Styles,
Conditional Formatting, New Rule, then "Use a formula to determine which cells to format"
and enter this formula. (Click the Format button to choose a suitable format)
Right click the Combo Box and select Properties. Set the LinkedCell and ListFillRange
properties. I've hard-coded my ListFillRange range reference but you can use Named Ranges
too, as in "=Tasks" without the quotation marks.
When finished, toggle off Design Mode on the Developer Tab.
Note the linked cell. That gives me the selected item of the list. Now I use another formula to
get the reference number which I have put in the cell below the linked cell (In this case, Cell
AJ3).
=MATCH(AJ2,AH:AH,0)-1
If I select the first item on the Combo Box, Cell AJ3 will show 1.
Here's the Conditional Formatting for the details part of the report. (Range C2:AI32)
And here's the Conditional Formatting for the list. (Range AG2:AH32)
I also added some Data Bars to the hours.
And we're done.
No VBA was used so you can send the file without explaining the need to enable macros.
You can now run a report that shows project statistics. It's a good way to get a general feel of
how much work you have done, and where it is located.
Details include:
Module Names
Procedure Names
Count of Children (Project and Modules)
Procedure Scope
Count of Lines (Project, Modules and Procedures)
Count of Comments (Project, Modules and Procedures)
Count of Declaration Lines (Project and Modules)
Count of Declaration Comments (Project and Modules)
Download the new version here.
P.S. If you have purchased an earlier version, contact me by email and I'll send a new set of
tools - free of charge!
1. Indent code within the active VB project, module, procedure or selected text.
2. Add line numbers to code within the active VB project, module, procedure.
3. Delete line numbers from code within the active VB project, module, procedure.
4. Add or delete line continuation to/from code within the active VB project, module,
procedure.
5. Export code from the active VB project, module, procedure to text files.
Options include:
Delete all instances of Debug.Print
Delete all instances of Debug.Assert
Delete all instances of Stop
Delete all orphan code
Delete blank lines (excess or all)
Delete comments
Delete indenting
Details include:
Module Name (Where the variable or constant is)
Scope (Public, Private, Type or Procedure)
Location (Declaration or procedure name)
Name (Variable or constant name)
Type (Variable or constant type, eg String, Long, etc)
Const (True or null, to discern between variables and constants)
Const Value (Value if constant)
Found in Project (Count within project)
Found in Report (Count within report)
Modules Count
Procedures Count
Unique Values
Duplicate Values
16. Show Project Statistics
Details include:
Module Names
Procedure Names
Count of Children (Project and Modules)
Procedure Scope
Count of Lines (Project, Modules and Procedures)
Count of Comments (Project, Modules and Procedures)
Count of Declaration Lines (Project and Modules)
Count of Declaration Comments (Project and Modules)
This is useful because the VBE does not indicate structured code.
18. Copy code for web. (Add html tags to your code to show it as indented and copy
it to the clipboard)
19. Select the current procedure (Select the procedure where the mouse cursor is
within)
And a detailed Help file is also included that you can open directly from the tools.
Impressed?
I believe my VBE tools to be the best value for money you can buy, less than a third
of the cost of it's nearest competition.
Not only that, even more tools are planned for the future and will be available to you
at no extra cost!
- Andrew Engwirda, creator of AET VBE Tools.
https://digital.com/blog/excel-tutorials/
http://www.engineerexcel.com/blog/
Importing text data into Excel for analysis is pretty straightforward, but what if you want to
use data from a chart in a book or some other reference? There’s a free tool that will let you
convert graphical charts into text data: Engauge Digitizer.
[Note: Want to learn even more about advanced Excel techniques? Watch my free training
just for engineers. In the three-part video series I'll show you how to easily solve engineering
challenges in Excel. Click here to get started.]
To be able to use the data in a spreadsheet, you’ll need to convert the chart to pairs of XY
data using Engauge Digitizer.
Once you have the software installed and open, select File > Import, then open
stress_concentration_hole.jpg. In the wizard that opens, click Next twice, then Finish.
Any image that’s color or grayscale will look terrible at first, but we can correct it by going to
Settings > Color Filter. Adjust the filters by clicking and dragging the green arrows until a
recognizable curve appears, then click OK:
Next, you’ll need to tell the software where the axis points are. Select the button with the
three red crosses ( ). Place the crosshair over the intersection of the x- and y-axes. Left-
click, then enter the coordinates for this axis point (x=0, y=2).
Repeat for the highest marked point on the y-axis (x=0, y=3.2) and on the x-axis (x=0.5,
y=2).
Next, add points by selecting the Point Match tool ( ) and clicking various points on the
curve. These are the points that will be exported later as XY coordinates.
With enough data points selected, the coordinates can be exported to a .csv (comma separated
values) file by choosing File and Export. Accept the default name and click Save.
Now Excel can import the data into a worksheet using a text data import. Go to Data > From
Text, then double-click on the .csv file that was just created. Make sure the delimited option
is selected and click Next. Select the comma delimited option, then click Finish. Choose a
location for the data.
To verify that the data was imported properly, select the X and Y column, then create a
scatter chart. You can use the Quick Access Toolbar button or go to the Insert tab and find
the Scatter Chart button.
Right-click the y-axis and choose Format Axis. Change the minimum and maximum to
match the chart in the image (minimum = 2.0, maximum = 3.2). Now the Excel chart is the
same as the original:
These data can be used in calculations going forward by using lookups or linear interpolation.
If the function you want to integrate is known in terms of a variable, you can perform the
integration using VBA instead of the tabular method in the last section.
[Note: Want to learn even more about advanced Excel techniques? Watch my free training
just for engineers. In the three-part video series I'll show you how to easily solve engineering
challenges in Excel. Click here to get started.]
Although you could integrate this equation using a table in the worksheet, VBA will allow
you to obtain a more accurate estimate by using a smaller time step (smaller slices).
Open up the VBA editor (Alt-F11) and insert a new module in the worksheet by right-
clicking in the Project window and choosing Insert > Module.
This module will contain two functions. The first will be a function for the velocity from the
equation above. Create a function named vel with one argument, t. Then enter in the equation
above:
Function vel(t)
vel = 24 * t – 1.2 * t ^ 2
End Function
The second function will calculate position by integrating velocity. This function is going to
have three arguments: an initial position (x0), a starting time (t1), and an ending time (t2).
For complex functions like this, it’s helpful to create a skeleton of what the function will do
using comments. Create the position function and the skeleton:
‘initialize variables
End Function
The last two steps, calculating the areas and summing them, will be done simultaneously
using a FOR loop.
With the skeleton complete, you can code each step. For the first step, defining the range of
the integral, we’ll create a variable int_range which is the difference between time t2 and
time t1:
int_range = t2 – t1
In the second step, you’ll slice this range up into a certain number of slices. The number of
slices will be defined as n. An n of 1000 should give good accuracy. The time step, dt, is the
width of one of those slices, so it will equal the integral range divided by the number of
slices.
‘discretize the integral into “n” slices, “dt” wide
n = 1000
dt = int_range / n
Before estimating the area of a slice using the trapezoidal rule, you’ll need to set some initial
conditions.
If you recall, the trapezoidal equation is evaluated from a to b. Since this example has time on
the x axis, we’ll call the time at the beginning of the slice “ta” and set it equal to our initial
start time (t1). We’ll call the time at the end of the slice tb, and set it equal to ta + dt.
‘initialize variables
ta = t1
tb = ta + dt
While t1 is a fixed point in time, ta and tb will change as the function moves from one slice to
the next.
There’s one more variable to initialize – the position. Initialize the position by setting it to the
argument x0 that is passed into the function:
Position = x0
With the initialization done, you can set up a FOR loop that will go through the slices and
calculate the area of each one. It will also sum up the total area of all the slices as it goes.
The FOR loop is going to run once for each slice, and there are n slices, so we’ll set this up
For j = 1 to n. Then the position will be calculated from the trapezoidal rule using the vel
function we defined above to calculate the height at the start and end of the slice:
For j = 1 To n
In order to move to the next slice, we’ll change the values of ta and tb. The new ta will be
equal to the old tb, and tb will increment by dt:
ta = tb
tb = ta + dt
Next
The Next statement closes out the loop.
When you’re all done, your code should look like this:
Function vel(t)
vel = 24 * t – 1.2 * t ^ 2
End Function
__________________________________________________________________________
int_range = t2 – t1
n = 1000
dt = int_range / n
‘initialize variables
ta = t1
tb = ta + dt
Position = x0
For j = 1 To n
ta = tb
tb = ta + dt
Next
End Function
Now that the Position function is complete, you can use it in the spreadsheet to do
calculations. First, use it to calculate the position at 20 seconds. Remember this function
needs three arguments passed to it: x0, t1 and t2. Type in the function name, then use Ctrl-
Shift-A to automatically populate the names of the arguments. The first argument, x0, is the
initial position in cell C5; t1 is the lower bound in cell C6, and t2 is the upper bound in cell
C7.
=Position(C5,C6,C7)
The Position function will give the result 1600 feet after 20 seconds.
Of course, the function can also be used to calculate the position at many different times. The
worksheet already contains time and velocity data. For the position column, the arguments
will be entered in a slightly different way. The initial position and the initial time are the
same as above. You can begin the function:
=Position(C5,C6,
Both of these arguments need to be made absolute references using F4 because they’ll be the
same for every time point in the table. However, the t2 argument will change as you go down
the table, so you can simply click within cell B17 and leave that as a relative reference.
=Position($C$5,$C$6,B17)
Select this cell and double-click the fill handle to fill the formula down the column. This will
give you the same end position of 1600 feet, but it also gives all the position and velocity data
points in between. You can plot these together. Select all three columns and insert a scatter
chart. The velocity data are much smaller numbers than the position, so plot those on a
secondary axis. Right-click the velocity data and choose Format Data Series. Select Plot
Series On Secondary Axis.
You can see that when the velocity is near zero, the slope of the position curve is flat. The
position increases more rapidly as velocity increases, and eventually gains more slowly as the
velocity begins to drop again. Finally, when the velocity is zero again, the position stops
increasing.
0Share
0Share
Tweet
Share
0Share
0Pin
There are two basic functions that allow you to pull data from tables you’ve created so that
you can use them in a calculation: VLOOKUP and HLOOKUP.
VLOOKUP, or vertical lookup, finds a value in a row of a vertical table by matching a value
in the first column. Its syntax is as follows:
[Note: Want to learn even more about advanced Excel techniques? Watch my free training
just for engineers. In the three-part video series I'll show you how to easily solve engineering
challenges in Excel. Click here to get started.]
lookup_value: the value in the first column that is being searched for
Although the range_lookup argument is optional, it’s often preferable to specify this as false,
as you’ll see later in this section.
The HLOOKUP, or horizontal lookup, function is basically the same function for a horizontal
table. It allows you to find a value in a column of a table by matching a value in the first row.
Its syntax is nearly identical:
lookup_value: the value in the first row that is being searched for
Worksheet 04g is set up to calculate the mass of a gas stored in a tank. In this example, there
is a 10 m3 tank filled with propane at 25°C, pressurized to 5 x 105 Pa. The ideal gas equation
can be used to calculate the mass of propane in the tank, but first you must look up the gas
constant based on the name of the gas. VLOOKUP can be used to get this value and return it
to cell C12. Begin the function:
=VLOOKUP(C5,
The name of the gas is entered in C5, so we can use this cell reference. For the second
argument, select the full table (not including headers).
=VLOOKUP(C5,F7:K22,
The column index number is the number of the column containing the data we want to return.
Since the gas constant data is in the third column on the table, enter the number 3 as the third
argument.
=VLOOKUP(C5,F7:K22,3
Finally, to make sure that a value is returned only when the name of the gas matches a value
in the first column exactly, type FALSE.
=VLOOKUP(C5,F7:K22,3,FALSE)
The data in the table is in kJ/kg*K, but the data needs to be in units of j/kg*K for the next
step, so multiply the lookup value by 1000.
=VLOOKUP(C5,F7:K22,3,FALSE)*1000
Verify that the function is returning the correct result by finding the gas constant for propane
in the table. Remember, it will be multiplied by 1000 in cell C12.
This worksheet already has named cells, so you can calculate the mass of gas in the tank by
entering
=P*V/(Rgas*T)
Now this spreadsheet is able to calculate the mass of any gas, in any tank, under any
conditions, as long as that gas is in the table. If you change the gas name in cell C5 to Argon,
the result updates automatically:
What happens if the range_lookup argument is set to TRUE instead of FALSE? TRUE allows
an approximate match to be returned, whereas FALSE forces an exact match. If this argument
is TRUE, and the gas name in cell C5 is misspelled “Argom,” an incorrect result is returned:
This happens because Excel is trying to match the misspelled word to a value in the table.
When it can’t find an exact match, it uses the first value that approximately matches. With
text data, it does this alphabetically, so it returns the gas constant for “Air” in this case.
If the range lookup is FALSE and the name is misspelled, it returns an error. In this case, it’s
preferable to return an error than to get an erroneous result.
Array formulas allow you to use multiple cell inputs rather than a single cell input. There are
two types of array formulas. One type of array formula returns a single value from multiple
inputs. A common example is the SUM function:
The other type of array formula is one that returns multiple outputs. A simple addition can be
used as an array formula:
[Note: Want to learn even more about advanced Excel techniques? Watch my free training
just for engineers. In the three-part video series I'll show you how to easily solve engineering
challenges in Excel. Click here to get started.]
[Note: Want to learn even more about advanced Excel techniques? Watch my free training
just for engineers. In the three-part video series I'll show you how to easily solve engineering
challenges in Excel. Click here to get started.]
LEARN MORE
Creating the second type of array formula is a little different from what you’ve done so far.
The biggest difference is that you’ll use Ctrl-Shift-Enter to finish the formula.
What’s the point of array formulas? We’ve already seen how to fill formulas into other cells
using the fill handle. There are three benefits to using array formulas:
1. They can reduce errors in spreadsheets. Because you are forced to edit the entire array at
once, you or someone else cannot mistakenly modify a formula in the middle of a range of
cells.
2. They simplify spreadsheets by allowing you to combine calculations that would take multiple
cells into a single cell.
3. They allow us to use named ranges on a selection of cells. This significantly improves formula
readability in Excel. Named ranges will be discussed later in this chapter.
The worksheet contains an example where we can use an array formula. It’s set up to
calculate airfoil lift as a function of varying velocity (v) and constant lift coefficient (C L),
area (A), and air density (ρ). The formula to calculate airfoil lift (L) is:
First, we’ll calculate the lift without using an array formula. Enter the formula in as
=C5*C6*C7*F7^2/2
The constant values in column C need to be absolute references, so click within each one and
type F4. Leave F7 as a relative reference.
Double-click the fill handle in the lower right corner to fill the rest of the column with this
formula.
One problem with performing the calculation this way is that it’s possible to mistakenly edit a
single cell. For example, if you were to delete the denominator from a single cell’s formula,
that cell’s value would be incorrect:
Excel flags the altered cell with a small green triangle to indicate that it doesn’t match the
surrounding cells, but those flags can be hidden or even ignored altogether.
Using an array formula will minimize the potential for errors. There are a few differences in
how array formulas are entered compared to standard formulas.
First, select all the cells that you want to return results to. Rather than enter the formula into
the cell itself, click within the formula bar and enter it there.
Enter =C5*C6*C7* in the formula bar, then select the entire range of velocities. You should
have:
=C5*C6*C7*F7:F16
=C5*C6*C7*F7:F16^2/2
To finish the array formula, type Ctrl-Shift-Enter. This is an important step to remember
when using array formulas.
In this case, it’s unnecessary to make the constants absolute references. The formula won’t be
copied into any other cells, so the reference won’t change.
When you complete the array formula with Ctrl-Shift-Enter, Excel will automatically add
curly brackets on either side of the formula to indicate it’s an array formula:
If you try to edit any single cell in the array, Excel will give an error message. To edit the
formula, select all of the output cells in the array, make your edit, then again type Ctrl-Shift-
Enter.
http://www.engineerexcel.com/blog/