Nov 4, 2009

Excellent Excel Tips

1. Change the case of cell contents – to UPPER, lower, Proper

Boss wants a report of top 100 customers, thankfully you have the data, but the customer names are all in lower cases. Fret not, you can Proper Case cell contents with proper() formula.

Example: Use proper("pointy haired dilbert") to get Pointy Haired Dilbert

Also try lower() and upper() as well to change excel cell value to lower and UPPER case

2. Clean up textual data with trim, remove trailing spaces

Often when you copy data from other sources, you are bound to get lots of empty spaces next to each cell value. You can clean up cell contents with trim() spreadsheet function.

Example: Use trim(" copied data ") to get copied data

3. Extract characters from left, right or center of a given text

Need the first 5 letters of that SSN or area code from that phone number? You can command excel to do that with left() function.

Example: Use left("Hi Beautiful!",2) to get Hi

Also try right(text, no. of chars) and mid(text, start, no. of chars) to get rightmost or middle characters. You can use right(filename,3) to get the extension of a file name

4. Find second, third, fourth element in a list without sorting

We all know that you can use min(), max() to find the smallest and largest numbers in a list. But what if you needed the second smallest number or 3rd largest number in the list? You are right, there is a spreadsheet function to exactly that.

Example: Use SMALL({10,9,12,14,26,13,4,6,8},3) to get 8

clip_image002

Also try large(list, n) to get the nth largest number in a list.

5. Find out current date, time with a snap

You have a list of customer orders and you want to findout which ones are due for shipping after today. The funny thing is you do this everyday. So instead of entering the date every single day you can use today()

Example: Use today() to get 08/13/2008 or whatever is today’s date

Also try now() to get current time in date time format. Remember, you can always format these date and times to see them the way you like (for eg. Aug-13, August 13, 2008 instead of 08/13/2008)

6. Convert those lengthy nested if functions to one simple formula with Choose()

Planning to create a gradebook or something using excel, you are bound to write some if() functions, but do you know that you can use choose() when you have more than 2 outcomes for a given condition? As you all know, if(condition, fetch this, or this) returns “fetch this” if the condition is TRUE or “or this” if the condition is FALSE.

Where as choose(m, value1, value2, value3, value4 ...) can return any of the value1,2.., based on the parameter m.

Example: Use CHOOSE(3,"when","in","doubt","just","choose")
to get doubt

Remember, you can always write another formula for each of the n parameters of choose() so that based on input condition (in this case 3), another formula is evaluated.

7. Repetitively print a character in a cell n number of times

You have the ZIP codes of all your customers in a list and planning to upload it to an address label generation tool. The sad part is for some reason, excel thinks zip codes are numbers, so it removed all the trailing zeros on the leftside of the zip code, thus making the 01001 as 1001. Worry not, you can use rept() the extra needed zeros.

Example: Use zipcode & REPT("0",5-LEN(zipcode)) to convert zipcode 1001 to 01001

You can use REPT("|",n) to generate micro bar charts in your sheet.

8. Find out the data type of cell contents

clip_image004

This can be handy when you are working off the data that someone else has created. For example you may want to capitalize if the contents are text, make it 5 characters if its a number and leave it as it is otherwise for certain cell value. Type() does just that, it tells what type of data a cell is containing.

Example: Use TYPE("dhandoo") to get 2

See the various type return values in the diagram shown right.

9. Round a number to nearest even, odd number

When you are working with data that has fractions / decimals, often you may need to find the nearest integer, even or odd number to the given decimal number. Thankfully excel has the right function for this.

Example: Use ODD(63.4) to get 65

Also try even() to nearest even number and int() to round given fraction to integer just below it.

Example: Use EVEN(62.4) to get 64
Use INT(62.99) to get 62

If you need to round off a given fraction to nearest integer you can use round(62.65,0) to get 63.

10. Generate random number between any 2 given numbers

When you need a random number between any two numbers, try randbetween(), it is very useful in cases where you may need random numbers to simulate some behavior in your spreadsheets.

0 comments:

Text Widget

Copyright © Vinay's Blog | Powered by Blogger

Design by | Blogger Theme by