In the real world, a simple average often isn't adequate for your needs.
For example, an instructor might calculate student grades by averaging a series of test scores but omitting the two lowest scores. Or you might want to compute an average that ignores both the highest and lowest values.
In cases such as these, the AVERAGE function won't do, so you must create a more complex formula. The following Excel formula computes the average of the values contained in a range named "scores," but excludes the highest and lowest values:
=(SUM(scores)-MIN(scores)-MAX(scores))/(COUNT(scores)-2)
Here's an example that calculates an average excluding the two lowest scores:
=(SUM(scores)-MIN(scores)-SMALL(scores,2))/(COUNT(scores)-2)
Everyday we come across some problem for which we try, research for hours and once solved, looks so easy in MS Excel.I like to keep a note of it and share with others, so people can use them.These notes are not necessarily my own writing but are the one which I came accross during my research over the net to find out solutions.
Sunday, December 05, 2004
Saturday, December 04, 2004
MS Excel: Word Count
Here is VBA Macro to count number of words in Excel spreadsheet as MS Excel does not have built in word counter like MS Word:
Sub NumberOfWords()
Dim NumberOfWord As Long
Dim RangeArea As Range
Dim Str As String
Dim Num As Long
For Each RangeArea In ActiveSheet.UsedRange.Cells
Str = Application.WorksheetFunction.Trim(RangeArea.Text)
Num = 0
If Str <> "" Then
Num = Len(Str) - Len(Replace(Str, " ", "")) + 1
End If
NumberOfWord = NumberOfWord + Num
Next RangeArea
MsgBox NumberOfWord
End Sub
Sub NumberOfWords()
Dim NumberOfWord As Long
Dim RangeArea As Range
Dim Str As String
Dim Num As Long
For Each RangeArea In ActiveSheet.UsedRange.Cells
Str = Application.WorksheetFunction.Trim(RangeArea.Text)
Num = 0
If Str <> "" Then
Num = Len(Str) - Len(Replace(Str, " ", "")) + 1
End If
NumberOfWord = NumberOfWord + Num
Next RangeArea
MsgBox NumberOfWord
End Sub
Friday, December 03, 2004
MS Excel: Delete Those Unwanted Sheets
Deleting the whole sheet, Excel makes it quick and painless:
Right-click on the sheet tab. Select Delete from the shortcut menu.
Right-click on the sheet tab. Select Delete from the shortcut menu.
Thursday, December 02, 2004
MS Excel: Add a Row or Column Easily
In Excel, the easiest way to insert or delete entire rows or columns is to use keyboard shortcuts: [Ctrl]+ and [Ctrl]-.
Drag across the row numbers or column letters in the worksheet frame to select the number of rows or columns you want to insert.
Then, you press [Ctrl]+ (use the plus sign on the numeric keypad) to insert entire rows or columns at that spot. You press [Ctrl]- to delete entire rows or columns.
Drag across the row numbers or column letters in the worksheet frame to select the number of rows or columns you want to insert.
Then, you press [Ctrl]+ (use the plus sign on the numeric keypad) to insert entire rows or columns at that spot. You press [Ctrl]- to delete entire rows or columns.
Wednesday, December 01, 2004
MS Excel:Copying Format
Sometimes you'll want to copy only a range's formatting. The easiest way to do this is to use the Format Painter button (it's the one that looks like a paint brush on the Standard toolbar). To do so, first select the cell or range whose formatting you want to copy, then click the Format Painter button. When the mouse pointer changes to a paint brush, select the range to which you want to copy those formats. When you release the mouse button, Excel will paste the formats to that range and the mouse pointer will return to normal.
To copy formatting to several nonadjacent cells or ranges, repeat the same steps, only double-click the Format Painter button. This way, the mouse pointer will remain a paint brush until you press [Esc]
To copy formatting to several nonadjacent cells or ranges, repeat the same steps, only double-click the Format Painter button. This way, the mouse pointer will remain a paint brush until you press [Esc]
Subscribe to:
Posts (Atom)