Tip & How-To about Microsoft Excel Computers & Internet

In the cell that you
want the result to appear in, enter the appropriate formula from the following
examples.

How to Count the
Occurrences of a Number

Use this formula

=SUM(IF(range=number,1,0))

where range is the
range that you want to search, and number is the number that you want to count.

NOTE: This formula
must be entered as an array formula. To enter an array formula, press
CTRL+SHIFT+ENTER.

How to Count the
Occurrences of a Text String

Method 1

Use this formula

=SUM(IF(range="text",1,0))

where range is the
range that you want to search, and text is the text that you want to find (the
text must be enclosed in quotation marks).

NOTE: The above
formula must be entered as an array formula. To enter an array formula, press
CTRL+SHIFT+ENTER.

Method 2

Use the COUNTIF()
function to count the occurrences of a text string. For example, use the
formula

=COUNTIF(range,"text")

where range is the
range of cells that you are evaluating, and text is the text string that you
want to count instances of (note that text must be enclosed in quotation
marks).

NOTE: This formula
must be entered as an array formula. To enter an array formula, press
CTRL+SHIFT+ENTER.

Wildcard characters can be used within the
COUNTIF function.

The asterisk character (*) represents more
than one character. For example, to count all the cells in the range a1:a10
that contain an "x," you can use the following formula:

=COUNTIF(a1:a10,"*x*")

The question mark
character (?) can also be used to represent one wildcard character -- for
example, to count all cells in the range whose second character is the letter,
such as "ax" or "bx."

=COUNTIF(a1:a10,"?x*")

- Start Microsoft Excel.
- Press ALT+F11 to start the Visual Basic Editor.
- On the
**Insert**menu, click**Module**. - Type the following code into the module sheet. Option Explicit 'Main Function Function SpellNumber(ByVal MyNumber) Dim Dollars, Cents, Temp Dim DecimalPlace, Count ReDim Place(9) As String Place(2) = " Thousand " Place(3) = " Million " Place(4) = " Billion " Place(5) = " Trillion " ' String representation of amount. MyNumber = Trim(Str(MyNumber)) ' Position of decimal place 0 if none. DecimalPlace = InStr(MyNumber, ".") ' Convert cents and set MyNumber to dollar amount. If DecimalPlace > 0 Then Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _ "00", 2)) MyNumber = Trim(Left(MyNumber, DecimalPlace - 1)) End If Count = 1 Do While MyNumber <> "" Temp = GetHundreds(Right(MyNumber, 3)) If Temp <> "" Then Dollars = Temp & Place(Count) & Dollars If Len(MyNumber) > 3 Then MyNumber = Left(MyNumber, Len(MyNumber) - 3) Else MyNumber = "" End If Count = Count + 1 Loop Select Case Dollars Case "" Dollars = "No Dollars" Case "One" Dollars = "One Dollar" Case Else Dollars = Dollars & " Dollars" End Select Select Case Cents Case "" Cents = " and No Cents" Case "One" Cents = " and One Cent" Case Else Cents = " and " & Cents & " Cents" End Select SpellNumber = Dollars & Cents End Function ' Converts a number from 100-999 into text Function GetHundreds(ByVal MyNumber) Dim Result As String If Val(MyNumber) = 0 Then Exit Function MyNumber = Right("000" & MyNumber, 3) ' Convert the hundreds place. If Mid(MyNumber, 1, 1) <> "0" Then Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred " End If ' Convert the tens and ones place. If Mid(MyNumber, 2, 1) <> "0" Then Result = Result & GetTens(Mid(MyNumber, 2)) Else Result = Result & GetDigit(Mid(MyNumber, 3)) End If GetHundreds = Result End Function ' Converts a number from 10 to 99 into text. Function GetTens(TensText) Dim Result As String Result = "" ' Null out the temporary function value. If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19... Select Case Val(TensText) Case 10: Result = "Ten" Case 11: Result = "Eleven" Case 12: Result = "Twelve" Case 13: Result = "Thirteen" Case 14: Result = "Fourteen" Case 15: Result = "Fifteen" Case 16: Result = "Sixteen" Case 17: Result = "Seventeen" Case 18: Result = "Eighteen" Case 19: Result = "Nineteen" Case Else End Select Else ' If value between 20-99... Select Case Val(Left(TensText, 1)) Case 2: Result = "Twenty " Case 3: Result = "Thirty " Case 4: Result = "Forty " Case 5: Result = "Fifty " Case 6: Result = "Sixty " Case 7: Result = "Seventy " Case 8: Result = "Eighty " Case 9: Result = "Ninety " Case Else End Select Result = Result & GetDigit _ (Right(TensText, 1)) ' Retrieve ones place. End If GetTens = Result End Function ' Converts a number from 1 to 9 into text. Function GetDigit(Digit) Select Case Val(Digit) Case 1: GetDigit = "One" Case 2: GetDigit = "Two" Case 3: GetDigit = "Three" Case 4: GetDigit = "Four" Case 5: GetDigit = "Five" Case 6: GetDigit = "Six" Case 7: GetDigit = "Seven" Case 8: GetDigit = "Eight" Case 9: GetDigit = "Nine" Case Else: GetDigit = "" End Select End Function

- Select the cell that you want.
- Click Paste Function on the Standard toolbar.
- Under Function category, click User Defined.
- Under Function name, click SpellNumber, and then click OK.
- Enter the number or cell reference that you want, and then click OK.

- Select the cell that you want.
- Click Insert Function on the Standard toolbar.
- Under Or select a category, click User Defined.
- In the Select a function list, click SpellNumber, and then click OK.
- Enter the number or cell reference that you want, and then click OK.

Apr 01, 2010 | Microsoft Windows XP Professional

Correct a #N/A error
Show All
Hide All
This error occurs when a value is not available to a function or formula.

- Optionally, click the cell that displays the error, click the button that appears , and then click
**Show Calculation Steps**if it appears. - Review the following possible causes and solutions.
Missing data, and #N/A or NA() has been entered in its place

Replace #N/A with new data.

**Note**You can enter**#N/A**in those cells where data is not yet available. Formulas that refer to those cells will then return #N/A instead of attempting to calculate a value.

Giving an inappropriate value for the lookup_value argument in the HLOOKUP, LOOKUP, MATCH, or VLOOKUP worksheet function

Make sure that the lookup_value argument (argument: The values that a function uses to perform operations or calculations. The type of argument a function uses is specific to the function. Common arguments that are used within functions include numbers, text, cell references, and names.) is the correct type of value — for example, a value or a cell reference, but not a range reference. Using the VLOOKUP, HLOOKUP, or MATCH worksheet function to locate a value in an unsorted table

By default, functions that look up information in tables must be sorted in ascending order. However, the VLOOKUP and HLOOKUP worksheet functions contain a range_lookup argument (argument: The values that a function uses to perform operations or calculations. The type of argument a function uses is specific to the function. Common arguments that are used within functions include numbers, text, cell references, and names.) that instructs the function to find an exact match even if the table is not sorted. To find an exact match, set the range_lookup argument to FALSE. The MATCH worksheet function contains a match_type argument that specifies the order the list must be sorted in to find a match. If the function cannot find a match, try changing the match_type argument. To find an exact match, set the match_type argument to 0.

Using an argument in an array formula that is not the same number of rows or columns as the range that contains the array formula

If the array formula (array formula: A formula that performs multiple calculations on one or more sets of values, and then returns either a single result or multiple results. Array formulas are enclosed between braces { } and are entered by pressing CTRL+SHIFT+ENTER.) has been entered into multiple cells, make sure that the ranges referenced by the formula have the same number of rows and columns, or enter the array formula into fewer cells. For example, if the array formula has been entered into a range 15 rows high (C1:C15) and the formula refers to a range 10 rows high (A1:A10), the range C11:C15 will display #N/A. To correct this error, enter the formula into a smaller range (for example, C1:C10), or change the range to which the formula refers to the same number of rows (for example, A1:A15).

Omitting one or more required arguments from a built-in or custom worksheet function

Enter all arguments (argument: The values that a function uses to perform operations or calculations. The type of argument a function uses is specific to the function. Common arguments that are used within functions include numbers, text, cell references, and names.) in the function.

Using a custom worksheet function that is not available

Make sure that the workbook that contains the worksheet function is open and the function is working properly.

Running a macro that enters a function that returns #N/A

Make sure that the arguments (argument: The values that a function uses to perform operations or calculations. The type of argument a function uses is specific to the function. Common arguments that are used within functions include numbers, text, cell references, and names.) in the function are correct and in the correct position.

Oct 31, 2008 | Computers & Internet

#VALUE? is an error indication meaning that Excel can't process the formula. It is most likely the result of a bad cell reference in your formula, for example, you may be trying to perform mathematical operations on a cell that contains non-numeric text data.

Jul 21, 2009 | Microsoft Office Excel 2007

Go to the cell you want this total in.

Type this formula:

=SUM(IF(Sheet2!C1:C10="EME",IF(Sheet2!N1:N10=1,1,0)))

make sure you end the formula with CTRL - SHIFT - ENTER which makes it an array formula. If you forget, go back to the cell with this formula and press F2 (to edit the cell) and press CTRL - SHIFT - ENTER to convert it to an array formula (Excel will show a little {...} around the formula).

Type this formula:

=SUM(IF(Sheet2!C1:C10="EME",IF(Sheet2!N1:N10=1,1,0)))

make sure you end the formula with CTRL - SHIFT - ENTER which makes it an array formula. If you forget, go back to the cell with this formula and press F2 (to edit the cell) and press CTRL - SHIFT - ENTER to convert it to an array formula (Excel will show a little {...} around the formula).

Dec 21, 2008 | Microsoft Excel for PC

Step1. Start Microsoft Excel and open the file you want to change.
Step2. Double-click on the cell where you want the total to appear.
Step3. Press the = key on the keyboard. This tells Excel that you are entering a formula into the cell.
Step4. Enter the formula, then press Enter. Follow the steps below for an example.
Step5. Enter an opening parenthesis character: (.
Step6. Enter a cell name. For example: =(E2.
Step7. Press the + key.
Step8. Enter another cell name and a closing parenthesis character: ). For example: =(E2+E3).
Step9. Enter a minus sign and a third cell name. For example: =(E2+E3)-E4.
Step10. Press the Enter key to accept the formula. The cell will display the sum of the first two cells minus the third cell.
$('.Article .Steps .Image').each(function(i,e){
e = $(e);
e.find('img').error(function(){
$(this).unbind();
e.remove();
});
});

Tips & Warnings

Tips & Warnings

- Formulas are just equations. Instead of adding or subtracting numbers you are adding and subtracting the contents of a cell.
- Excel includes a number of predefined functions to use as well. You can combine the predefined functions into your own formula. (See "How to Use Provided Excel Formulas.")

Dec 03, 2008 | Microsoft Office Professional 2007 Full...

1,897 people viewed this tip

Usually answered in minutes!

×