Pages

2/27/07

Want To Learn How 'COUNT IF' Works?

COUNTIF is the function, which is used to count number of cells in a list that matches a particular condition.

Syntax

=COUNTIF(list,”condition”)

Here list is the range of cells selected and condition can be in the form of arithmetic, text or logical expression.

Find below some of the examples:

In the above picture the range of cells between Row 2 and Row 6 are counted by different expressions.

Arithmetic expressions:

=COUNTIF(B2:B6,”>500”)
Here condition is to count cells that are greater than 500. The range of cells is between B2 and B6. There are two cells (B2 is 780 and B4 is 650) that meet the condition, so COUNTIF function returns 2

Text expression:

=COUNTIF(E2:E6, “Lara”)
Here condition is to count cells that have name Lara. The range of cells is between E2 and E6. Three cells B2, B3 and B5 matches the given condition, so COUNTIF function returns 3

Logical expression:

=COUNTIF(H2:H6, “false”)
Here condition is to count cells that have logical value FALSE. The range of cells is between H2 and H6. Two cells have the matching logical value, so COUNTIF function returns 2.

Intersting posts are yet to come. So keep visiting this blog. :-)

2/26/07

Solve formatting Problem While Importing Data.

TRIM function is used to remove unwanted spaces from text. When importing data from other applications into Excel, there will be lot of spaces formed in between words.

This function helps to remove all the spaces except for single spaces between words.

Syntax for TRIM function

=TRIM(cell reference)

Here cell reference is the cell that has the text to be trimmed. You can either directly type the cell reference or select the cell using your mouse. Remember that only one cell can be selected to perform this function.

Go through the below examples to get a clear idea about the syntax.


Assume that in cell E11 we have the following text.
‘Global       Marketing      Company     -     Tokyo’
=TRIM(E11)

The result we get after using the TRIM function will be the following

‘Global Marketing Company - Tokyo’