0% found this document useful (0 votes)
4 views

MS Excel Notes NMCP

The document provides an overview of spreadsheet basics, including cell addresses, expressions, and various functions available in MS Excel such as mathematical functions, IF, COUNT, COUNTIF, SUM, SUMIF, VLOOKUP, and HLOOKUP. It explains how to use these functions with examples and syntax, as well as techniques for copying and pasting formulas with absolute cell references. Additionally, it includes exercises for practical application of the concepts discussed.

Uploaded by

prajwal dehankar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

MS Excel Notes NMCP

The document provides an overview of spreadsheet basics, including cell addresses, expressions, and various functions available in MS Excel such as mathematical functions, IF, COUNT, COUNTIF, SUM, SUMIF, VLOOKUP, and HLOOKUP. It explains how to use these functions with examples and syntax, as well as techniques for copying and pasting formulas with absolute cell references. Additionally, it includes exercises for practical application of the concepts discussed.

Uploaded by

prajwal dehankar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Spreadsheet Basics

A spreadsheet comprises of a grid of cells, as shown in fig above. Each cell is accessed through a
unique address, called as cell address. The cell address comprises of Column Header followed by
Row Number. For example a cell at the intersection of Column D and Row 7 will be cell D7 (refer to
fig above).

Expressions
An expression is any entity that evaluates to a unique value (called as return value). An expression is
any valid combination of operands and operators (if required), that results in a unique value.
Expression begins with ‘=’ character.

Examples

=A1+B1

=12.5+7.12+8.9*13

=SIN(P6)-0.22

=(MAX(A1,B1,C1)+MIN(A1,B1,C1))/2

Note: To view expression Click FORMULAS Tab. This displays Formula Auditing Section. Click Show
Formulas.
Copy + Paste on FORMULA
Let us assume a worksheet as shown below has been created

Here, value of D is equal to A+2B-C. The cell G2 therefore contains a formula

=D7+2.5*E7-F7

Now to calculate values of D for rows 8 to 11 we can use one of the copy +paste techniques available
in MS Excel

Technique1: Click cell G7. Then move pointer to bottom right corner of the cell. A thin + sign
appears. Now drag mouse down to fill cells G8 to G11. These cells will now contain appropriate
formulas as shown below.

Technique 2: Click cell G7. Press Ctrl+C. Now select cells G8 to G11. Press Ctrl+V

Copy + Paste with Absolute Cell Address


Let us assume a worksheet as shown below has been created

Here, value of D is equal to A+2B-C. C has only one value (Cell F7). The cell G2 therefore contains a
formula =D7+2.5*E7-F7
If this formula is copied to next cell it automatically becomes =D8+2.5*E8-F8, but the required
formula is =D8+2.5*E8-F7.

To ensure that copy+paste works properly enter formula =D7+2.5*E7-$F$7 in cell G7.

Now to calculate values of D for rows 8 to 11 we can use one of the copy +paste techniques as
described earlier.

Here the cell address in the format $column$row_number is called as Absolute Address.

Mathematical Functions
Following is a list of some of the math functions available in MS Excel

Function Description
ABS function Returns the absolute value of a number
ACOS function Returns the arccosine of a number
ATAN function Returns the arctangent of a number
CEILING function Rounds a number to the nearest integer or to the nearest multiple of
significance
COS function Returns the cosine of a number
DEGREES function Converts radians to degrees
EVEN function Rounds a number up to the nearest even integer
EXP function Returns e raised to the power of a given number
FACT function Returns the factorial of a number
FLOOR function Rounds a number down, toward zero
INT function Rounds a number down to the nearest integer
LN function Returns the natural logarithm of a number
LOG function Returns the logarithm of a number to a specified base
LOG10 function Returns the base-10 logarithm of a number
MOD function Returns the remainder from division
ODD function Rounds a number up to the nearest odd integer
PI function Returns the value of pi
POWER function Returns the result of a number raised to a power
QUOTIENT function Returns the integer portion of a division
RADIANS function Converts degrees to radians
ROUNDDOWN Rounds a number down, toward zero
function
ROUNDUP function Rounds a number up, away from zero
SIGN function Returns the sign of a number
SIN function Returns the sine of the given angle
SQRT function Returns a positive square root
SUM function Adds its arguments
SUMIF function Adds the cells specified by a given criteria
SUMSQ function Returns the sum of the squares of the arguments
TAN function Returns the tangent of a number
TRUNC function Truncates a number to an integer
IF Function
The IF function is used for selectively executing expression(s) based on a logical expression/ test
condition. This function returns value of evaluated expression.

Syntax

IF(logical_expression, [expT], [expF])

Where

logical_expression is an expression that result in True/ False on evaluation.

expT (optional) is an expression to be evaluated and returned if logical_expression evaluates to TRUE

expF (optional) is an expression to be evaluated and returned if logical_expression evaluates to


FALSE

Referring to fig above

Enter data as shown above in cells BS1, BT1, BU1, BS2, BT2

Enter in cell BU2 following IF function

=IF(BS2>BT2,BS2,BT2)

You can now change content of cells BS2 and BT2 to see if the IF() works

Exercise 1
Exercise to calculate Shear Force and Bending Moment at a given section for a SSB with a point load
as shown below.
Data required: W, a, l, x

Preparation and Data Entry – Prepare a worksheet and enter values of W, l, a, x as shown below

Assuming the worksheet is as shown above …

Calculation of b

b=l-a

To calculate b enter following expression in cell CA2

=BX2-BY2

Calculation of Ra

Ra=W*b/l

To calculate Ra, enter following expression in cell CB2


=BW2*CA2/BX2

Calculation of Rb

Rb=W-Ra

To calculate Ra, enter following expression in cell CC2

=BW2-CB2

Calculation of Fx

We know that

for x<b, Fx=-Rb

for x=b, Fx has two values.

Just to the right of point load Fx1=-Rb

Just to the left of point load Fx2=Ra

For x>b, Fx=Ra

Referring to worksheet fig above, you can see that there are two cells titled Fx1 and Fx2

Cell titled Fx1 will hold value of Fx or Fx1

Cell titled Fx2 will hold value of Fx2 (used only for the case x=b)

To calculate Fx1, enter following expression in cell CD2

=IF(BZ2<=CA2,-CC2,CB2)

To calculate Fx2, enter following expression in cell CE2

=IF(BZ2=CA2,CB2,"")

Calculation of Mx

We know that

for x<=b, Mx=Rb*x

for x>b, Mx=Rb*x-W*(x-b)

To calculate Mx, enter following expression in cell CF2

=IF(BZ2<=CA2,CC2*BZ2,CC2*BZ2-BW2*(BZ2-CA2))

The completed worksheet looks as below


You can see that as x is not equal to b, Fx2 has no value.

To experiment, change value of x. Set value of x equal to value of b. The result will be as shown
below.

COUNT function
The COUNT function counts the numbers in the specified argument list or it counts cells in the
specified range that contain numbers. The list or range can contain data of different types. COUNT
function counts only numbers.

Syntax

COUNT(value1, value2, value3, ...)

Where, value1, value2, value3… is the list of item, cell reference, or range within which you want to
count numbers.

Note: When a list is specified arguments that are numbers, dates, or numbers enclosed within quotes
are counted. When a range is specified only numbers are counted.

Examples

=COUNT(12,Two,"Two") , returns 1

=COUNT(12,Two,"2") , returns 2

=COUNT(12,Two,"2","12/7/2019") , returns 3

Referring to fig above


=COUNT(K1:N3) , returns 9

Referring to fig above

=COUNT(K1:N3) , returns 7

(Note: “12.34”, “52” have not been counted)

COUNTIF function
COUNTIF function counts number of cells within a given range that meet specified criteria/ condition.

Syntax

COUNTIF(range, criteria)

Where, range is the area where to search for values, and criteria specifies what values to count.

e.g.

=COUNTIF(A5:C10,”>25”) , counts all values greater than 25 in the area A5 to C10

Examples

Referring to fig above

=COUNTIF(R1:R5,"Twenty") , returns 1

=COUNTIF(R1:R5,"*one") , returns 2

Note: “*” is a wildcard character. Here “*one” is treated as any text ending with “one”

=COUNTIF(R1:R5,"Twenty*") , returns 3
Note: Here “Twenty*” is treated as any text beginning with “Twenty”

Referring to fig above

=COUNTIF(U1:U7,5) , returns 2

=COUNTIF(U1:U7,">10") , returns 5

SUM Function
The SUM function in adds the values in the specified argument list or specified range. You can add
individual values, cell references or ranges or a mix of all three.

For example:

=SUM(5,3,10,20) , returns 28

=SUM(A1:F12), returns sum of all numbers in the range A1 to F12. Non numeric values are ignored.

Referring to fig above

=SUM(K1:N3) , returns 352.66

SUMIF Function
Use the SUMIF function to sum the values in a range that meet criteria that you specify.

For example, suppose that in a column that contains numbers, you want to sum only the values that
are larger than 5. You can use the following formula: =SUMIF(B2:B25,">5").
If required, you can apply the criteria to one range and sum the corresponding values in a different
range. For example, the formula =SUMIF(B2:B5, "Valid", C2:C5) sums only the values in the range
C2:C5, where the corresponding cells in the range B2:B5 equal "Valid".

Syntax

SUMIF(range, criteria, [sum_range])

Where,

range - The range of cells that you want evaluated by criteria.

criteria - The criteria in the form of a number, expression, a cell reference, text, or a function ( i.e. 56,
">32", B5, "32", "valid", TODAY() ).

Important: Any text criteria or any criteria that includes logical or mathematical symbols must be
enclosed in double quotation marks ("). If the criteria is numeric, double quotation marks are not
required.

sum_range - Optional. The actual cells to add, if you want to add cells other than those specified in
the range argument. If the sum_range argument is omitted, Excel adds the cells that are specified in
the range argument.

Note: You can use the wildcard characters—the question mark (?) and asterisk (*)—as the criteria
argument. A question mark matches any single character; an asterisk matches any sequence of
characters. If you want to find an actual question mark or asterisk, type a tilde (~) preceding the
character.

The SUMIF function returns incorrect results when criteria string is longer than 255 characters. Though
preferable, the sum_range argument does not have to be of the same size and shape as the range
argument. The actual cells that are added is controlled by size and shape of range argument.

For example

1. If range is a1:c3, and sum_range is p1:r3, then values from p1:r3 will be added
2. If range is a1:c3, and sum_range is p1:r2, then values from p1:r3 will be added
3. If range is a1:c3, and sum_range is p1:t12, then values from p1:r3 will be added

Examples
Referring to figures above

=SUMIF(M1:P5,">40") , returns 762 (Sum of all values greater than 40 lying in the area M1:p5)

=SUMIF(U1:X5,"Valid",M1:P5) , returns 444

=SUMIF(U1:X5,"Valid",M1:R5) , returns 444

Referring to figure above

=SUMIF(AA2:AA11,"Rice",AB2:AB11) , returns 73243.7

=SUMIF(AA2:AA11,"<>Sugar",AB2:AB11) , returns 135864.7


VLOOKUP function
The VLOOKUP function finds items in a table or range by row. Item corresponding to a lookup value is
returned. The lookup value and the value to be returned are from the same row of a table or range.
The data is organized so that the value you look up is to the left of the value you want to find.

Syntax of VLOOKUP function is as follows:

VLOOKUP(lookup_value, table_array, col_index_no, [match_type])

Where,

lookup_value - The value you want to look up, also called the lookup value.

table_array - The range where the lookup value is located. Remember that the lookup value should
always be in the first column in the range for VLOOKUP to work correctly.

col_index_no - The column number in the range that contains the return value. For example, if you
specify B2: D11 as the range, you should count B as the first column, C as the second, and so on.

match_type – Optional. You can specify TRUE if you want an approximate match or FALSE if you
want an exact match of the return value. If you don't specify anything, the default value will always
be TRUE or approximate match.

Referring to figure above

1. Let us say we want Amount spent on Sand, from the table above

Here “Sand” will be the lookup value. The value we want to find lies in column 2 of the range
AD1:AE7
=VLOOKUP(“Sand”,AD1:AE7,2) , returns 20000.00

2. Let us say we want Amount spent on item at Sr No 6, from the table above

Here 6 will be the lookup value. The value we want to find lies in column 3 of the range AC1:AE7

=VLOOKUP(6,AC1:AE7,3) , returns 5600.00


Referring to figure above

VLOOKUP to get Rate of item 2.13.1.2 will be VLOOKUP(“2.13.1.2”,AJ1:AM13,3)

VLOOKUP to get Unit of item 2.13.1.2 will be VLOOKUP(“2.13.1.2”,AJ1:AM13,4)

VLOOKUP to get Rate of item “Pipes, cables etc. exceeding 80 mm dia. but not exceeding 300 mm
dia.” will be

VLOOKUP(“Pipes, cables etc. exceeding 80 mm dia. but not exceeding 300 mm dia.”,AK1:AM13,2)

Using match_type argument

match_type = FALSE , returns exact match if available, else returns Value not available (#N/A) error.

match_type = TRUE , returns approximate match if exact match is not available

Referring to figure above

=VLOOKUP(4.5,AC1:AE7,3,TRUE) , returns 12600.00 (approximate match)

Whereas =VLOOKUP(4.5,AC1:AE7,3,FALSE) , returns #N/A error as exact match for 4.5 is not
available

=VLOOKUP(200,AC1:AE7,3,TRUE) , returns 5600.00 (approximate match)

HLOOKUP Function
HLOOKUP searches for a value in the top row of a table or an array of values, and then returns a
value in the same column from a row you specify in the table or array. Use HLOOKUP when your
comparison values are located in a row across the top of a table of data, and you want to look down
a specified number of rows. The H in HLOOKUP stands for "Horizontal."

Syntax
HLOOKUP(lookup_value, table_array, row_index_num, [match_type])

Where,

lookup_value - The value you want to look up, also called the lookup value.

table_array - The range where the lookup value is located. Remember that the lookup value should
always be in the first row in the range for HLOOKUP to work correctly.

row_index_no - The row number in the range that contains the return value.

match_type – Optional. You can specify TRUE if you want an approximate match or FALSE if you
want an exact match of the return value. If you don't specify anything, the default value will always
be TRUE or approximate match.

If match_type is TRUE, the values in the first row of table_array must be placed in ascending order
left to right: ...-2, -1, 0, 1, 2,... , A-Z, FALSE, TRUE; otherwise, HLOOKUP may not give the correct
value. If match_type is FALSE, table_array does not need to be sorted.

Note:

Uppercase and lowercase text are equivalent.

If HLOOKUP can't find lookup_value, and match_type is TRUE, it uses the largest value that is less
than lookup_value.

If lookup_value is smaller than the smallest value in the first row of table_array, HLOOKUP returns
the #N/A error value.

If match_type is FALSE and lookup_value is text, you can use the wildcard characters, question mark
(?) and asterisk (*), in lookup_value. A question mark matches any single character; an asterisk
matches any sequence of characters. If you want to find an actual question mark or asterisk, type a
tilde (~) before the character.
Referring to fig above

To get Tc for M35 grade from 4th row we can write

=HLOOKUP("M35",BL3:BQ16,4)

Or

=HLOOKUP(BP3,BL:BQ16,4)

This expression returns 0.5


Exercise 2
Exercise to demonstrate extraction and interpolation of Tc using Table 19, IS 456 shown above.

Given Data – Number of Bars, Bar Dia., Dimensions of section, Grade of Concrete

Referring to fig above.

Enter text in cells AW2 to AW8 as shown above

Enter Data in cells AX2, AX3, AX5, AX6 and AX8


To calculate As, enter following expression in cell AX4

=PI()*AX3*AX3/4*AX2

To calculate percentage of steel pt, enter following expression in cell AX7

=100*AX4/(AX5*AX6)

Referring to fig above – Table 19 from IS-456 has been entered in a worksheet as shown above. We
can use this data as explained below

To get the column number for given grade from the range BC4:BH4

We can use HLOOKUP for this purpose


Enter text in cell AW10 as shown above

To get column number for given grade, enter following expression in cell AX10

=HLOOKUP(AX8,BC3:BH4,2,TRUE)

This returns 5, which is the column containing Tc values for M30 grade (Refer to Table 19 above)

To check if HLOOKUP() is working properly, change grade in cell AX6, the value in cell AX10 should
change accordingly.

To get row numbers for particular percentage of steel we can use VLOOKUP. VLOOKUP with
match_type set to FALSE is useful when exact match is available. As in our case exact match is less
likely we must set match_type to TRUE. This will match with a value of pt that is just less than or
equal to the specified value (lookup value) of pt

Use VLOOKUP over BA5:BB17, to get row number for max pt <= given lookup value (0.63), as below

=VLOOKUP(0.63,BA5:BB17,2,TRUE)
Referring to fig above, we can see that this will return 3

Adding 1 to this return value will give us next row number. These two rows are needed for
interpolating value of Tc

Referring to fig above

Enter text in cells AW12, AW13, AW14 as shown

To get value of rL, enter following VLOOKUP() in cell AX13

=VLOOKUP(AX7,BA5:BH17,2,TRUE)
To get rU, enter following expression in cell AX14

=AX13+1

Now we can get values of Tc corresponding to these rows and required grade of concrete

Referring to fig above, enter text in cells AW16, AW17, AW18

Enter following VLOOKUP() expressions in cells AX17 and AX18 respectively

=VLOOKUP(AX13,BB5:BH17,AX10,FALSE)

=VLOOKUP(AX14,BB5:BH17,AX10,FALSE)

Alternatively we can use following HLOOKUP() expressions in cells AX17 and AX18 respectively

=HLOOKUP(AX8,BC3:BH17,AX13+2,FALSE)

=HLOOKUP(AX8,BC3:BH17,AX14+2,FALSE)
To get values of pt corresponding to rL and rU

Enter text in cells AW20, AW21, AW22 as shown above

Enter following VLOOKUP() expressions in cells AX21 and AX22 respectively

=VLOOKUP(AX13,AZ5:BA17,2,FALSE)

=VLOOKUP(AX14,AZ5:BA17,2,FALSE)

Tc corresponding to pt can now be calculated using interpolation.

Refer to following fig for understanding the terms used

ptW=ptU-ptL

ptD=pt-ptL

TcW=TcU-TcL

Tc=TcL+TcW x ptD/ptW
Referring to fig above, enter text in cells AW24, AW25, AW26, AW27, AW28

Now enter following expressions in cells AX25, AX26, AX27, AX28 respectively

=AX22-AX21 (ptW=ptU-ptL)

=AX7-AX21 (ptD=pt-ptL)

=AX18-AX17 (TcW=TcU-TcL)

=AX17+AX27*AX26/AX25 (Tc=TcL+TcW x ptD/ptW)

You might also like