# 20 Tips in How to Solve Common problems using Excel Formulas

1. To get the first name of a person, use =left(name,find(â€ť â€ś,name)-1)
2. To calculate mortgage payments, use =PMT(interest-rate,number-of-payments,how-much-loan)
3. To get nth largest number in a range, use =large(range,n)â€¦
4. To get nth smallest number in a range, use = small(range,n)â€¦
5. To generate a random phone number, use =randbetween(1000000000,9999999999), needs analysis toolpak if you are using excel 2003 or earlierâ€¦
6. To count number of words in a cell, use =len(trim(text))-len(SUBSTITUTE(trim(text),â€ť â€ś,â€ťâ€ť))â€¦
7. To count positive values in a range, use =countif(range,â€ť>0?)â€¦
8. To calculate weighted average, use SUMPRODUCT() function
9. To remove unnecessary spaces, use =trim(text)
10. To format a number as SSN using formulas, use =text(ssn-text,â€ť000-00-0000?)â€¦
11. To find age of a person based on DOB, use =TEXT((NOW()-birth_date)&â€ťâ€ť,â€ťyy â€śâ€ťyearsâ€ťâ€ť m â€śâ€ťmonthsâ€ťâ€ť dd â€śâ€ťdaysâ€ťâ€ťâ€ť), output will be like 27 years 7 months 29 days
12. To get name from initials from a name, use IF(), FIND(), LEN() and SUBSTITUTE() formulasâ€¦
13. To get proper fraction from a number (for eg 1/3 from 6/18), use =text(fraction, â€ś?/?â€ť)
14. To get partial matches in vlookup, use * operator like this: =vlookup(â€śabc*â€ť,lookup_range,return_column)
15. To simulate averageif() in earlier versions of excel, use =sumif(range, criteria)/countif(range, criteria)
16. To debug your formulas, select the portions of formula and press F9 to see the result of that portionâ€¦
17. To get the file extension from a file name, use =right(filename,3) (doesnâ€™t work for files that have weird extensions like .docx, .htaccess etc.)
18. To quickly insert an in cell micro-chart, use REPT() functionâ€¦
19. COUNT() only counts number of cells with numbers in them, if you want to count number of cells with anything in them, use COUNTA()
20. Using named ranges in formulas saves you a lot of time. To define one, just select some cells, and go to menu > insert > named ranges > define