Tips For Microsoft Excel

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 24

Tips for Microsoft Excel

DCountA Function :

The DCountA function returns the number of cells in a column or database that contains
nonblank values and meets a given criteria.

The syntax for the DCountA function is:

DCountA( range, field, criteria )

range is the range of cells that you want to apply the criteria against.

field is the column to count the values. You can either specify the numerical position of
the column in the list or the column label in double quotation marks.

criteria is the range of cells that contains your criteria.

For example:

Let's take a look at an example:


Based on the Excel spreadsheet above:

=DCountA(A4:D8, "Unit Cost", A1:B2) would return 2


=DCountA(A4:D8, 3, A1:B2) would return 2
=DCountA(A4:D8, "Quantity", A1:A2) would return 3
=DCountA(A4:D8, 2, A1:A2) would return 3
Back

NestedIf Function:

It is possible to nest multiple IF functions within one Excel formula. You can nest up to 7
IF functions to create a complex IF THEN ELSE statement.

The syntax for the nesting the IF function is:

IF(condition1, value_if_true1, IF(condition2, value_if_true2, value_if_false2)

This would be equivalent to the following IF THEN ELSE statement:

IF condition1 THEN
value_if_true1
ELSEIF condition2 THEN
value_if_true2
ELSE
value_if_false2
END IF

This syntax example demonstrates how to nest two IF functions. You can nest up to 7 IF
functions.

condition is the value that you want to test.

value_if_true is the value that is returned if condition evaluates to TRUE.

value_if_false is the value that is return if condition evaluates to FALSE.

For example:

Let's take a look at an example:


Based on the Excel spreadsheet above:

=IF(A1="10X12",120,IF(A1="8x8",64,IF(A1="6x6",36))) would return 120


=IF(A2="10X12",120,IF(A2="8x8",64,IF(A2="6x6",36))) would return 64
=IF(A3="10X12",120,IF(A3="8x8",64,IF(A3="6x6",36))) would return 36
Back

Date Function:

The Date function returns the serial number of a date.

The syntax for the Date function is:

Date(year, month, day)

year is a number that is between one and four digits

• If the year is between 0 and 1899, the year value is added to 1900 to determine the year.
• If the year is between 1900 and 9999, the Date function uses the year value as the year.
• If the year is greater than 9999, the Date function will return the #NUM! error.

month is a number representing the month value. If the month value is greater than 12,
the Date function adds that number of months to the first month of the year specified in
the year parameter.

day is a number representing the day value. If the day value is greater than the number of
days in the month specified, the Date function add that number of days to the first day in
the month specified in the month parameter.

For example:

Let's take a look at an example:

Based on the Excel spreadsheet above:

=Date(2003,11,30) would return 'Nov 30, 2003'


=Date(2003,11,31) would return 'Dec 1, 2003
=Date(A1, A2, A3) would return 'Nov 30, 2003'
Back

Convert Date to Text:


Date field in excel can be converted to text using the following formula.
=Text(A1,"dd")
Above function will give the date part. i.e. if value of A1 is 01/05/2005,
the result will be 01

Similarly month & year can be obtained using =text(A1,"mm") and


=text(A1,"yyyy") respectively.

What if you want date in DDMMYYYY format but in text ?.


Use this formula:
=concatenate(text(a1,"dd"),text(a1,"mm"),text(a1,"yyyy"))
The result of above formula would be 01052005.

DateDIF Function:

The DateDif function returns the difference between two date values, based on the
interval specified.

The syntax for the DateDif function is:

DateDif( start_date, end_date, interval )

start_date and end_date are the two dates to calculate the difference between.

interval is the interval of time to use to calculate the difference between date1 and date2.
Below is a list of valid interval values.

Interval Explanation
Y The number of complete years.
M The number of complete months.
D The number of days.
MD The difference between the days (months and years are ignored).
YM The difference between the months (days and years are ignored).
YD The difference between the days (years and dates are ignored).
For example:

Let's take a look at an example:


Based on the spreadsheet above, the function would return the following values:

=DateDif(A1, A2, "Y") would return 1.


=DateDif(A1, A3, "D") would return 455.
=DateDif(A1, A3, "YD") would return 90.
Back

VLookUp Function :

The VLookup function searches for value in the left-most column of table_array and
returns the value in the same row based on the index_number.

The syntax for the VLookup function is:

VLookup(value, table_array, index_number, not_exact_match)

value is the value to search for in the first column of the table_array.

table_array is two or more columns of data that is sorted in ascending order.

index_number is the column number in table_array from which the matching value must
be returned. The first column is 1.
not_exact_match determines if you are looking for an exact match based on value. Enter
FALSE to find an exact match. Enter TRUE to find an approximate match, which means
that if an exact match if not found, then the VLookup function will look for the next
largest value that is less than value.

Note:

If index_number is less than 1, the VLookup function will return #VALUE!.

If index_number is greater than the number of columns in table_array, the VLookup


function will return #REF!.

If you enter FALSE for the not_exact_match parameter and no exact match is found, then
the VLookup function will return #N/A.

For example:

Let's take a look at an example:

Based on the Excel spreadsheet above:

=VLookup(10251, A1:B21, 2, FALSE) would return "Tofu"


=VLookup(10251, A1:C21, 3, FALSE) would return $18.60
=VLookup(10248, A1:B21, 2, FALSE) would return #N/A
would return "Queso
=VLookup(10248, A1:B21, 2, TRUE)
Cabrales"
Back

Round Function:

The Round function returns a number rounded to a specified number of digits.

The syntax for the Round function is:

Round(number, digits)

number is the number to round.

digits is the number of digits to round the number to.

For example:

Let's take a look at an example:

Based on the Excel spreadsheet above:

=Round(A1, 0) would return 663


=Round(A1, 1) would return 662.8
=Round(A2, -1) would return 50
=Round(55.1, -1) would return 60
=Round(-23.67, 1) would return -23.7
Back

RoundDown Function :

The RoundDown function returns a number rounded down to a specified number of


digits. (Always rounds towards 0.)

The syntax for the RoundDown function is:

RoundDown(number, digits)

number is the number to round down.

digits is the number of digits to round the number down to.

For example:

Let's take a look at an example:

Based on the Excel spreadsheet above:


=RoundDown(A1, 0) would return 662
=RoundDown(A1, 1) would return 662.7
=RoundDown(A2, -1) would return 50
=RoundDown(55.1, -1) would return 50
=RoundDown(-23.67, 1) would return -23.6
Back

RoundUp Function :

The RoundUp function returns a number rounded down to a specified number of digits.
(Always away from 0.)

The syntax for the RoundUp function is:

RoundUp(number, digits)

number is the number to round up

digits is the number of digits to round the number up to.

For example:

Let's take a look at an example:


Based on the Excel spreadsheet above:

=RoundUp(A1, 0) would return 663


=RoundUp(A1, 1) would return 662.8
=RoundUp(A2, -1) would return 60
=RoundDown(55.1, -1) would return 60
=RoundDown(-23.67, 1) would return -23.7
Back

Trunc Function :

The Trunc function returns a number truncated to a specified number of digits.

The syntax for the Trunc function is:

Trunc(number, digits)

number is the number to truncate.

digits is optional. It is the number of decimal places to display in the resulting truncated
number. If this parameter is omitted, the Trunc function will assume 0.

For example:

Let's take a look at an example:

Based on the Excel spreadsheet above:

=Trunc(A1) would return 662


=Trunc(A1, 0) would return 662
=Trunc(A1, 1) would return 662.7
=Trunc(A2, -1) would return 50
=Trunc(67.891) would return 67
=Trunc(-23.67, 1) would return -23.6
Back

Int Function:

The Int function returns the integer portion of a number.

The syntax for the Int function is:

Int( expression )

expression is a numeric expression whose integer portion is returned.

Note: If the expression is negative, the Int function will return the first negative number
that is less than or equal to the expression.

For example:

Let's take a look at an example:

Based on the Excel spreadsheet above:


=Int(A1) would return 210
=Int(A2) would return 2
=Int(A3) would return -3
=Int(-4.5) would return -5
Back

Sum Function:

The Sum function adds all numbers in a range of cells and returns the result.

The syntax for the Sum function is:

Sum( number1, number2, ... number_n )

or

Sum ( cell1:cell2 )

For example:

Let's take a look at an example:


Based on the Excel spreadsheet above:

=Sum(B2, B3) would return 17.7


=Sum(B3, B5, 45) would return 57.6
=Sum(B2:B6) would return 231.2
Back

SumIf Function:

The SumIf function adds all numbers in a range of cells, based on a given criteria.

The syntax for the SumIf function is:

SumIf( range, criteria, sum_range )

range is the range of cells that you want to apply the criteria against.

criteria is used to determine which cells to add.

sum_range are the cells to sum.

For example:

Let's take a look at an example:


Based on the Excel spreadsheet above:

=SumIf(A2:A6, D2, C2:C6) would return 218.6


=SumIf(A:A, D2, C:C) would return 218.6
=SumIf(A2:A6, 2003, C2:C6) would return 7.2
=SumIf(A2:A6, ">=2001", C2:C6) would return 12.6
Back

Text Function:

The Text function returns a value converted to text with a specified format.

The syntax for the Text function is:

Text( value, format )

value is the value to convert to text.

format is the format to display the results in.

For example:

Let's take a look at an example:


Based on the Excel spreadsheet above:

=Text(A1, "$#,##0.00") would return "$7,678.87"


=Text(A1, "0") would return "7679"
=Text(A2, "0.0") would return "123.7"
=Text(1277, "#,##0") would return "1,277"
=Text(C1, "yyyy/mm/dd") would return "2003/12/31"
=Text(C1, "mmm dd, yyyy") would return "Dec 31, 2003"
Back

Concatenate Function:

The Concatenate function allows you to join 2 or more strings together.

The syntax for the Concatenate function is:

Concatenate( text1, text2, ... text_n )

There can be up to 30 strings that are joined together.

For example:

Let's take a look at an example:


Based on the Excel spreadsheet above:

=Concatenate(A1, A2) would return "Alphabet"


=Concatenate("Tech on the ", "Net") would return "Tech on the Net"
=Concatenate(A1, "bet soup") would return "Alphabet soup"
Back

Left Function:

The Left function allows you to extract a substring from a string, starting from the left-
most character.

The syntax for the Left function is:

Left( text, number_of_characters )

text is the string that you wish to extract from.

number_of_characters indicates the number of characters that you wish to extract starting
from the left-most character.
For example:

Let's take a look at an example:

Based on the Excel spreadsheet above:

=Left(A1, 5) would return "Alpha"


=Left(A2, 8) would return "techonth"
=Left("Excel", 2) would return "Ex"
Back

Mid Function:

The Mid function extracts a substring from a string (starting at any position).

The syntax for the Mid function is:

Mid( text, start_position, number_of_characters )

text is the string that you wish to extract from.

start_position indicates the position in the string that you will begin extracting from. The
first position in the string is 1.

number_of_characters indicates the number of characters that you wish to extract.

For example:

Let's take a look at an example:

Based on the Excel spreadsheet above:

=Mid(A1, 5, 4) would return "abet"


=Mid(A2, 7, 3) would return "The"
=Mid("Excel", 1, 2) would return "Ex"
Back

Right Function:

The Right function extracts a substring from a string starting from the right-most
character.

The syntax for the Right function is:


Right( text, number_of_characters )

text is the string that you wish to extract from.

number_of_characters indicates the number of characters that you wish to extract starting
from the right-most character.

For example:

Let's take a look at an example:

Based on the Excel spreadsheet above:

=Right(A1, 4) would return "soup"


=Right(A2, 6) would return "thenet"
=Right("Excel", 3) would return "Ex"
Back

Substitute Function:
The Substitute function replaces a set of characters with another.

The syntax for the Substitute function is:

Substitute( text, old_text, new_text, nth_appearance )

text is the original string to use to perform the substitution.

old_text is the existing characters to replace.

new_text is the new characters to replace old_text with.

nth_appearance is optional. It is the nth appearance of old_text that you wish to replace. I
f this parameter is omitted, then every occurrence of old_text will be replaced with
new_text.

For example:

Let's take a look at an example:

Based on the Excel spreadsheet above:

=Substitute(A1, "bet", "con", 1) would return "Alphacon soup"


=Substitute(A2, "t", "4", 2) would return "techon4henet"
=Substitute(A2, "t", "4") would return "4echon4hene4"
Back

Proper Function:

The Proper function sets the first character in each word to uppercase and the rest to
lowercase.

The syntax for the Proper function is:

Proper( text )

text is the string argument whose first character in each word will be converted to
uppercase and all remaining characters converted to lowercase.

For example:

Let's take a look at an example:

Based on the Excel spreadsheet above:

=Proper(A1) would return "Alphabet Soup"


would return "Tech On The
=Proper(A2)
Net"
=Proper(A3) would return "Alpha Beta"
=Proper("excel") would return "Excel"
Back

Lower Function:

The Lower function converts all letters in the specified string to lowercase. If there are
characters in the string that are not letters, they are unaffected by this function.

The syntax for the Lower function is:

Lower( text )

text is the string to convert to lowercase.

For example:

Let's take a look at an example:

Based on the Excel spreadsheet above:

=Lower(A1) would return "alphabet soup"


=Lower(A2) would return "techonthenet"
=Lower("Excel") would return "excel"
Back

Clean Function:

The Clean function removes all nonprintable characters from a string.


The syntax for the Clean function is:

Clean( text )

text is the value that has all nonprintable characters removed from.

For example:

Let's take a look at an example:

Based on the Excel spreadsheet above:

=Clean(A1) would return "hi there"


=Clean(A2) would return '"this is a test"
Back

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy