Saturday 14 May 2011

Top 10 Useful Excel Tips And Tricks


I’ve collected some popular tips and tricks that might be useful and interesting for you.

1. Wrapping texts in a single cell.
You can wrap texts in a cell. Doing this, it will display multiple lines with in the
cell. You can wrap texts in a cell by pressing ALT + Enter in the cell. Or you can go to
Format –> Cells –> Alignment and select Wrap Text.


2. use of Enter key
When you hit the ENTER key in Excel, you will automatically drop down to the
cell just below it. But you can change this default and change this feature.
a. Go to Tools -> Option
b. Select the Edit Tab
c. Under Move Selection after Enter, you can either select a different
Direction for the drop down box, or remove the check in front of the option according to your need.
Note: If uncheck it, the ENTER key will not move
you to another cell rather you’ll need to use the arrow keys to move around.

3. Current date or time
You can use the following formula to get current date with time in excel.
=NOW() ?shows both, current date and time.
=TODAY() ?shows only today’s date.

In bonus with this trick, =Time(hours, minutes, seconds) value gives you the time you entered in specific format.
For example: =TIME(1,2,3) outputs, 1:02 AM
=TIME(21,2,3) outputs, 9:02 AM
4. Shading the rows alternately
This tips can be helpful if you most of the time gets confused on the rows you are watching. Applying shades as you have seen in most of the graphical representation papers around you helps you to avoid confusion.
To do this,
• Highlight the range of cells or rows or columns that you want to format by left clicking and dragging the area.
• Go to Format–>Conditional Formatting

• In the Conditional Formatting dialogue box, select Formula Is from the first drop-down list box, and enter =MOD(ROW(),2)=0 in the second box.

• Click the Format button to bring up the Format Cells dialog box.
• Select the Patterns tab and specify a color for the shaded rows.

• Click OK twice to return to your worksheet.
5. Change the color of sheet names:

Right click on sheet you want to change the color of and select “Tab color” option to change the worksheet tab colors. Group them with similar colors if you have lot of sheets, it lets you to easily recognize the specific sheet.
6. Sort the texts from Left to right instead of up to bottom

If your data flows from left to right instead of top to bottom, just change the sort orientation from “sort options” in the Data –> sort menu–> Option.



7. Move or copy a worksheet
You may know that you can just drag and drop a worksheet to a different spot in the workbook. But for you folks who get joy from dialog boxes (and truthfully, this one gives you more options), here you go:
To move or copy a worksheet
1. Right-click a tab, and then click Move or Copy on the shortcut menu.
2. In the Move or Copy dialog box, you have options:
o To move the worksheet to a spot within its own workbook, select a sheet in the Before sheet box.
o To move the worksheet to another open workbook, select the workbook in the To book list and then click OK.
o To keep a copy of the worksheet you’re moving in this workbook (rather than just moving it), select the Create a copy box.


8. Insert a line break in a cell
Press ALT+ENTER to start a new line while you’re typing or editing data.

9. Skip through your worksheet using shortcut
As you use ALT + TAB to skip through the opened program window in windows you can skip through the worksheets.
To move one worksheet to the right
* Press CTRL+PAGE DOWN.
To move one worksheet to the left
* Press CTRL+PAGE UP.

10. Calculator in excel toolbar
Excel is the master of calculator, but sometimes you need a handy calculator. To get the calculator in the toolbar,
• On the View menu, click Toolbars, and then click Customize.
• Click the Commands tab.
• In the Categories: list, click Tools, and in the Commands: list, click Custom (Important: The one with the gray calculator graphic!).
• Drag the selected command from the Commands: list to a toolbar.
• Click Close.


Drag and drop to the tool bar
Hope these tricks collected were useful to you.
Posted: 23 Mar 2010 02:04 AM PDT
Creating a simple webpage in HTML. Before you start coding, let me assume the following facts,
You know simple html tags like, HTML, BODY, TITLE, HEAD, TABLE, LISTS, etc. and some parameters like, WIDTH, HEIGHT, COLOR, BORDER, CELLSPACING, PADDING, etc.
Lets make a simple HTML page format as below:

To do so, we’ll be using TABLE, H1,H2, FONTS, HYPERLINKS, LISTS, HR etc.
Open up the notepad save it as “webpage.html” (with quotes)
And then create a table with similar format:

Your page will contain Page header, Navgation bar, Footer, Contents part.
To create a table similar to the format above, use the following tags.
<html>
<head>
<title>Page title</title></head>
<table width=”100%” cellpadding=”10″>
<tr width=”100% valign=”top”><h2> PAGE HEADER </h2>
<td width=”20%” valign=”top”>
NAVIGATION BAR
</td>
<td width=”80%” valign=”top”>
CONTENTS PART
</td>
<tr width=”100%” valign=”top”>FOOTER PART</tr>
</html>
Now you have the basic layout ready. The things we need now is to fill the blank tables with appropriate contents.
For example:
<html>
<body>
<table width=”100%” cellpadding=”10″>
<!– page title ->
<tr width=”100% valign=”top”><h2>Page Title</h2>
<!– end of page title ->
<hr>
</tr>
<tr>
<!– Navigation bar ->
<td width=”20%” valign=”top”>
<ul>
<li><a href=”#”>Home</a></li>
<li><a href=”#”>About Us</a></li>
<li><a href=”#”>Feedback</a></li>
<li><a href=”#”>Contact</a></li>
</ul>
</td>
<!– End of Navigation ->
<!– Body Contents ->
<td width=”80%” valign=”top”>
YOUR Contents goes here, type your text, insert hyperlinks, lists, images here to beautify your web page.
</td>
<!– End of contents ->
</tr>
</table>
<!– footer notes ->
<tr width=”100%” valign=”top”><p align=”center”>Copyright Footer note</P></tr>
<!– end of footer notes ->
</body>
</html>
The above code will give output in your browser as we’ve planned to (see the first image). Playing with the tags makes you further clear and adapted to web designing using HTML.

Adding images and other hyperlinks.
After making simple page, you can add images, colored fonts, hyperlinks etc to make it more user friendly.
You can use <a href=”#”> and <img src=”#”/> tags to include hyper links and images.
See the example below(put it under the content body tag):
<a href=”http://www.google.com”>
<img border=”0″ src=”http://www.google.com.np/intl/en_com/images/logo_plain.png”/>
</a>
<h3>is the most popular search engine in this world.</h3>
<br/>
<a href=”http://www.google.com”>Click here</a> to go to Google.com
In the above example, Google’s logo image will be loaded using, <img> tag and that tag is enveloped under <a href> tag which enables the image to be clicked.
Similarly you can envelope text to create hyperlinks.
You can also change the size and font colors by applying the following syntax.
<FONT COLOR=”color_name” size=”size_in_number”>FONT TO BE FORMATED</FONT>

To create lists of texts or navigation,
Example:
<ul>
<li><a href=”#”>Home</a></li>
<li><a href=”#”>About Us</a></li>
<li><a href=”#”>Feedback</a></li>
<li><a href=”#”>Contact</a></li>
</ul>
<ul> tag creates a list block and <li> lists them in proper line break. In above example, we’ve listed the text with hyperlinks.
After tweaking and playing with the tags you may get the good result.
For instance take the sample from below:
<html>
<body>
<table width=”100%” cellpadding=”10″>
<!– page title ->
<tr width=”100% valign=”top”><h2>Page Title</h2>
<!– end of page title ->
<hr>
</tr>
<tr>
<!– Navigation bar ->
<td width=”20%” valign=”top”>
<ul>
<li><a href=”#”>Home</a></li>
<li><a href=”#”>About Us</a></li>
<li><a href=”#”>Feedback</a></li>
<li><a href=”#”>Contact</a></li>
</ul>
</td>
<!– End of Navigation ->
<!– Body Contents ->
<td width=”80%” valign=”top”>
<a href=”http://www.google.com”><img border=”0″ src=”http://www.google.com.np/intl/en_com/images/logo_plain.png”/></a><h3>
is the most popular search engine in this world.</h3>
<br/>
<a href=”http://www.google.com”>Click here</a> to go to <Font color=”green” size=“2”>Google.com</font>
</td>
<!– End of contents ->
</tr>
</table>
<!– footer notes ->
<tr width=”100%” valign=”top”><p align=”center”>Copyright Footer note</P></tr>
<!– end of footer notes ->
</body>
</html>
It will show you the page like this:

Hope this tutorial gave you some basic idea of designing webpage using notepad and HTML.
Posted: 22 Mar 2010 06:12 PM PDT
mySQL database is most popular database system used in internet. Today I am going to show you how to create a mySQL database using PHP script.
To create a new database, we’ll be using the following syntax here;
CREATE DATABASE database_name
But, we must use the mysql_query() function to execute the above command. This mysql_query() function is used to send a query to a MySQL connection.
After we have base commands ready, we can arrange it to access and create your new MySQL database.
Before we proceed further, you must keep in mind that you must have your web host supporting at least one MySQL database connection and you have full access to your web host control panel. However we are not going to enter the controlpanel zone, but the PHP script surely will have to.
Now let’s assume the following,
$dbhost=’localhost’;  // is your local host name.
$dbusername=’anup’;  // is your web host username
$dbuserpass=’anup123′;  // is your web host cpanel password
$dbname=’anup_database;  // is your new database name to be created
The following script will create a new database named, anup_database.
<?php
$dbhost=’localhost’;  // is your local host name.
$dbusername=’anup’;  // is your web host username
$dbuserpass=’anup123′;  // is your web host cpanel password
$dbname=’anup_database;  // is your new database name to be created
$con = mysql_connect ($dbhost, $dbusername, $dbuserpass);
if (!$con)
{
die(‘Could not connect: ‘ . mysql_error());
}
if ((“CREATE DATABASE $dbname”,$con))
{
echo “Your new Database created”;
}
else
{
echo “Error creating database: ” . mysql_error();
}
mysql_close($con);
?>
$con variable is set to connect to the database, if it fails to it outputs with Could not connect mysql error.
If it becomes successful to create new database, it outputs with Your new Database created. Else it will result Error creating database with mysql error listed.
Here, w are successfully done to create a new database.
Since we’ve created database we can create tables after then.
Let me not end this tutorial right here, else you might be smothering about what to do next.
Let me teach you how to create a table using PHP again.
To Create a table, we are using the following syntax.
CRATE TABLE table_name
(
column_name1 data_type,
column_name2 data_type,
column_name3 data_type,
….

)
It will create the specified table in the specified mysql database name.
While creating we added the CREATE DATABASE syntax in the mysql_query() function to execute it. In the same way we’ll be adding CREATE TABLE syntax to the mysql_query(function).

For an example, lets say that, we need to create a table named “people”, with three columns. And we need the column names: “FirstName”, “LastName” and “Age”.
The following command creates table with $dbname variable (it varies with variable you provide before the command executes), here in our case, anup_database, as we’ve specified $dbname=’anup_database’; as our data base name.
// Create table
mysql_select_db(“$dbname”, $con);
$sql = “CREATE TABLE people
(
FirstName varchar(15),
LastName varchar(15),
Age int
)”;
// Execute query
mysql_query($sql,$con);
mysql_close($con);
Note:The above script is not complete and your browser will never accept ist as a PHP code until your code begins and ends with<? or <php?
Varchar(15) data type allows you to enter only 15 characters (you can see that I’ve added it after the column FirstName and LastName). And int (in the Age column) refers to an integer.
Upto now what far we’ve reached is, with complex combinations of commands and functions, we will be able to create new database with new table and columns.
You can easily combine the both scripts in to one file, like in the example below:
<?php
$dbhost=’localhost’;  // is your local host name.
$dbusername=’anup’;  // is your web host username
$dbuserpass=’anup123′;  // is your web host cpanel password
$dbname=’anup_database;  // is your new database name to be created
$con = mysql_connect ($dbhost, $dbusername, $dbuserpass);
if (!$con)
{
die(‘Could not connect: ‘ . mysql_error());
}
if ((“CREATE DATABASE $dbname”,$con))
{
echo “Your new Database created”;
}
else
{
echo “Error creating database: ” . mysql_error();
}
mysql_close($con);
// Create table
mysql_select_db(“$dbname”, $con);
$sql = “CREATE TABLE people
(
FirstName varchar(15),
LastName varchar(15),
Age int
)”;
// Execute query
mysql_query($sql,$con);
mysql_close($con);
?>
Hope that was pretty helpful.

No comments:

Post a Comment