Nairobi

Wednesday, August 12, 2009

Locking Cells in Excel

One easy way to achieve this is to make A16 and B2 the only unlocked cells on the worksheet. By default, all cells are locked. You can use Format - Cells - Protection - uncheck the Locked checkbox to unlock the cells.
In Excel 2000 and earlier you can simply protect the worksheet with Tools - Protection - Protect Sheet. In Excel 2002 you will have to use Tools - Protection - Protect Sheet and then uncheck the option for "Select locked cells".
After the sheet is successfully protected, hitting enter in one unprotected cell will take you to the next unprotected cell.
If protecting the worksheet is not practical, you would have to resort to a Worksheet_Change macro that sensed which cell just changed. For information on how to enter worksheet event handler macros, see tip055
Here is a sample macro:

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$B$2"
Range("A16").Select
Case "$A$16"
Range("B2").Select
End Select
End Sub

Wednesday, July 8, 2009

Using the FV, PV, and PMT function

1. If you have 20,000 in your account right now and you plan on investing 5,000 each year with a rate of return of 8%, how much will your investment be in 10 years?
FV(8%,10,-5000,-20000,0)

Why is it negative (-) for the yearly investment and the initial investment? Funds flowing away from you should be entered as a negative (-) number.

2. The same rule applies to PV.

3. If you have an initial investment of 100 and you want to have 305 in your account in 12 months, how much do you have to put into your account every month if the rate of return is 12%?
PMT(12%/12,12,100,305.02,0)

Friday, July 3, 2009

Adding Data Labels to an Excel Chart

Data labels are used to indicate what the main part of the chart represents. Depending on the type of chart you are creating, data labels can mean quite a bit. For instance, if you are formatting a pie chart, the data can be more difficult to understand if you don't include data labels.

To add data labels, follow these steps:

1.Activate the chart by clicking on it, if necessary.
2.Make sure the Layout tab of the ribbon is displayed.
3.Click the Data Labels tool. Excel displays a number of options that control where your data labels are positioned.
4.Select the position that best fits where you want your labels to appear.

Wednesday, July 1, 2009

Comparing Lists for Duplicates

Imagine for a moment that you have a worksheet that contains lists of part numbers. On one worksheet you have a list of part numbers, and on another worksheet you have a similar list. The lists are not identical, however, and you want to determine if a particular part number on one list also appears on the other.
One solution is to somehow combine the lists, but add some sort of indicator as to which original list the particular part number came from. This approach (or a variation thereon) is, in fact, the approach taken by many Excel users.
What if you don't want to combine the lists, however? In this case, there is a very easy way to do the comparison. Follow these steps:
1.Make sure there is a blank column just to the right of each list of part numbers on each worksheet.
2.Select the part numbers on the first worksheet and give them a name such as "PartList1". (Use Insert | Name | Define to assign the name to the list.)
3.Select the part numbers on the second worksheet and give them a name such as "PartList2".
4.Assuming that the first part number on the first worksheet is in cell A2, enter the following formula in cell B2:
=ISNUMBER(MATCH(A2,PartList2,0))
1.Copy the formula down so that a copy appears to the right of each part number on the first worksheet.
2.Repeat steps 4 and 5 on the second worksheet, but use the following formula:
=ISNUMBER(MATCH(A2,PartList1,0))
When you are done, either TRUE or FALSE will appear to the right of each part number on each worksheet. If TRUE appears, the associated part number appears on the other worksheet. If FALSE appears, then the part number is unique and does not appear on the other worksheet.
Another approach is to use an array formula to do the comparisons. You could follow the same steps shown above, but use the following formula in step 4 (and PartList1 variation in step 6):
=OR(EXACT(A2,PartList2))
Since this is an array formula, you would enter it by using Shift+Ctrl+Enter. The result is the same TRUE and FALSE designation described above.
Regardless of which formula approach you use, you can use the AutoFilter capabilities of Excel to limit what is shown on either worksheet. If you filter to show only the FALSEs, you will have a list of all unique part numbers. If you filter to show TRUEs, then you will have a list of duplicates.

Hiding Rows Based on a Cell Value

Excel provides conditional formatting which allows you to change the color and other attributes of a cell based on the content of the cell. There is no way, unfortunately, to easily hide rows based on the value of a particular cell in a row. You can, however, achieve the same effect by using a macro to analyze the cell and adjust row height accordingly. The following macro will examine a particular cell in the first 100 rows of a worksheet, and then hide the row if the value in the cell is less than 5.
Sub HideRows()
BeginRow = 1
EndRow = 100
ChkCol = 3

For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value < 5 Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
Next RowCnt
End Sub
You can modify the macro so that it checks a different beginning row, ending row, and column by simply changing the first three variables set in the macro. You can also easily change the value that is checked for within the For ... Next loop.
You should note that this macro doesn't unhide any rows, it simply hides them. If you are checking the contents of a cell that can change, you may want to modify the macro a bit so that it will either hide or unhide a row, as necessary. The following variation will do the trick:
Sub HURows()
BeginRow = 1
EndRow = 100
ChkCol = 3

For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value < 5 Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub

Tuesday, June 16, 2009

CrowdSourcing - The Definition

Crowdsourcing is a neologism for the act of taking a task traditionally performed by an employee or contractor, and outsourcing it to an undefined, generally large group of people or community in the form of an open call. For example, the public may be invited to develop a new technology, carry out a design task (also known as community-based design[1] and distributed participatory design), refine or carry out the steps of an algorithm (see Human-based computation), or help capture, systematize or analyze large amounts of data (see also citizen science).
The term has become popular with business authors and journalists as shorthand for the trend of leveraging the mass collaboration enabled by Web 2.0 technologies to achieve business goals. However, both the term and its underlying business models have attracted controversy and criticism.

NetSquared Tech forum in Nairobi

Feel Free to Join.
www.meetup.com/Nairobi
 
Creative Commons License
Excel Tips by David Kandie is licensed under a Creative Commons Attribution 3.0 Unported License.