Five Excel Functions for Faster Data Analysis | by Suraj Gurav | Towards Data Science

“Think about a world without Excel. That’s just impossible for me.” — Satya Nadella, CEO, Microsoft
Microsoft Excel, the global spreadsheet tool first released in 1985 for analysis of data in tabular form. It made the data and number analysis accessible to everyone. It does not only boosted ⚡️ productivity but also triggered a new way of thinking about business.
Yess! Today, I am going to tell you the story of Microsoft Excel. Through the story, I will walk you through the five Excel functions with interesting examples to speed-up your data analysis.
How about some takeaways ???Yes! I am sharing some pro-tips to improve your productivity while using Excel. So keep an eye on this 📌 symbol through the story for pro-tips.
Over the past decade, we all observed a massive wave of innovative software for analysis and visualization of the data. Still, Microsoft Excel is a favorite tool for a regular professional. Especially for managers, it is the best tool to manage, manipulate, and visualize all kinds of data quickly without much extra effort.
Without wasting more time in the intro, let’s start with the Excel functions. I am using this Dummy_People dataset.
Want to pull out the count of different values quickly ⚡️ and easily?Then COUNTIFS() is your friend.
When you are trying to count the appearance of an item in a column or the appearance of multiple variables in multiple columns in Excel, then you should use the function COUNTIFS().
For example: Counting how many items of a specific category are sold from an inventory dataset, or finding out how many males of age 20 years got infected by Coronavirus in a COVID-19 dataset, or simply finding out how many first-class passengers of 60 years old survived in the famous Titanic dataset.
COUNTIFS() counts the number of values that meet specified criteria
🎯 This function accepts multiple [Range, Criteria] pairs and returns the number of values, which satisfy all the [Range, Criteria] pairs.
Here is the syntax:
=COUNTIFS(Range_1, Criteria_1, Range_2, Criteria_2,............)
Everything is good with examples. So here comes the one,
In this example, I used the COUNTIFS() as,
=COUNTIFS($F$2:$F$20,$K6,$G$2:$G$20,L$5)
where, [$F$2:$F$20,$K6] and [$G$2:$G$20,L$5] are the [Range, Criteria] pairs. This formula counts the number of cells when the value at $K6 is in the range $F$2:$F$20 and value at L$5 is in the range $G$2:$G$20 . Type this formula in the formula bar and press enter to get the count in the cell L6 (in the yellow box in the image). Simply drag the cursor over the entire set of cells to get the final output as shown in the green box in the image.
🎯 COUNTIFS() can be treated as a mega function in Excel as it accepts as high as 127 pairs of Range & Criteria
The story doesn’t end here. Have a look at these interesting facts about COUNTIFS().
What do these types of criteria mean? — Look at this snippet
=COUNTIFS( G2:G20, "Gloucester", C2:C20, ">30", E2:E20, 165)This will count how many people from "Gloucester" are older than 30 years and height 165
Rather than using the mouse click and dragging the cursor, use this key combination to select the dataset faster. Simply click on the first cell you want to select, hold down Ctrl + Shift and use the up or down arrow key to select all the data in the column above or below respectively, or press the left or right arrow key to select everything in the row to the left or right.
Irrespective of the domain, the function VLOOKUP() is a popular, widely used, and recognized function in Excel.
VLOOKUP() looks for a specified value in a specified range and returns the information
It saves your hassle of shuffling back-and-forth through different Excel sheets and tables to get the expected value.
What does the VLOOKUP() take for doing your work? 🎯Nothing, except these 4 inputs —
Lookup value: Value you want to search or lookup
Range: Range of columns or values where the lookup value is located
Column: Column number which has the information you want to return
Boolean: TRUE if you want an approximate match, FALSE if you want an exact match for the lookup value. However, this input is optional.
And, here comes the syntax followed by an example:
=VLOOKUP(Lookup value, Range, Column, Boolean)
In this example, I used VLOOKUP() as,
=VLOOKUP(J4,A2:H20,8,FALSE)
Here, Excel will search for the First_Name as mentioned in the cell J4 in the range A2:H20. As an output, I returned the email address matching the First_Name, which is present in the 8th column. With the optional argument FALSE, I returned an exact match for the value in J4.
One limitation of VLOOKUP() is, the Column or the value you want to return must be present on the right side of the Lookup_Value in the dataset. To overcome this, Excel launched the new function — XLOOKUP() . Currently, this functionality is available only for Microsoft 365 subscribers. More information about its usage can be found here.
In data analysis and visualization, you will come across a situation where you need to repeat your last action multiple times. All you need to do is hit the F4 key where ever you want to repeat your last action.Also, F4 is the shortcut for adding absolute cell reference in Excel formulas! In any formula when you type a cell reference, simply keep pressing F4, and then Excel will iterate you through all the absolute cell reference possibilities, for example — $A1, A$1, and $A$1
In almost all the domains, you always calculate some aggregate values in your data analysis such as addition, maximum, minimum, counting number of values, and so on.
For aggregating values, these are three of the most frequently used functions. As its name suggests, the function SUM() adds the numbers in a specific set of cells, like — =SUM(starting_cell : ending_cell) In our example, to calculate the SUM of all values in the Age column, I used
=SUM(C2:C20)
However, rather than mentioning the range of cells, you can always specify the cell numbers separated by a comma, like — =SUM(cell_1, cell_2, cell_3, ...)or the actual numbers you want to add separated by a comma, like =SUM(number_1, number_2, number_3, ...)
Then why to use the SUM() function ❓🎯 Because it saves your efforts to type “+” after every time you type cell numbers or the actual numbers you want to add.
Similarly, the AVERAGE() function calculates the arithmetic mean of the numbers in a specific set of cells, like — =AVERAGE(starting_cell : ending_cell)
I calculated the AVERAGE of all values in the Weight column using,
=AVERAGE(D2:D20)
The COUNT() function will give you a count of numeric values in the list of supplied arguments. So, if you provide the range of cells as a list of arguments, the function COUNT() will count only those cells, which have numbers.
But what if you want to count the cells which contain text or logical values also ❓
No Worries !!!
🎯 Simply add alphabet “A” at the end of the above COUNT() function to make a new function COUNTA() which will count the number of cells that contain numeric as well as text values. The rest of all syntax remains the same.
In the above image, in the yellow box, you can see all the value aggregation functions that I discussed and in the green box, you will find the results.
There can be situations, where you want to select an entire row or a column. These combinations can make your way easier. Just place the cursor in the cell which belongs to the column or row you want to select and then press,Ctrl + Space to select the entire column and Shift + Space to select the entire row. Again, you can combine Ctrl + Shift + Space trio to select the huge chunk of the data.
It is one of the most commonly used text function in Excel. The CONCATENATE() in Excel let you join the text data in the multiple cells, for example, joining the house number, street names, city to form a complete address or product name and usage to form its description or even joining customer ID, first name and last name to make a complete customer detail.
CONCATENATE() combines the values from multiple cells
Here is the syntax —
=CONCATENATE(Text_1, Text_2, Text_3, ....)
And here is how it is used in our data,
🎯 However, it is absolutely not necessary to mention a cell number for the text, you can always type-in the texts which you want to combine. Just enclose the text in double quotation mark and separate it with a comma like this “Text_1", "Text_2", "Text_3”
Check out this example —
Here, the function =CONCATENATE(A2, “ “, B2) joins the text in A2 and the text in B2 with space “ “ between them to get the full name of the person.
Well, just like other functions, CONCATENATE() also throws some errors 🚩
#NAME? : It means you missed the quotation marks within which the text should be enclosedQuotation Marks in the result: If you missed the comma separating the two texts, then the additional, undesired quotation marks will appear in the final result
#NAME? : It means you missed the quotation marks within which the text should be enclosed
Quotation Marks in the result: If you missed the comma separating the two texts, then the additional, undesired quotation marks will appear in the final result
Irrespective of your work domain, there are cases when you want to split the data from one column into 2 columns or you want to select only a few text characters from a text value in a cell. For example, splitting the name of the customer into the first and last name or selecting the name of the city from the entire address, or selecting a product name from the entire product description.
In short, you want to do the opposite of the function CONCATENATE(). Then these 3 functions are at your service.
LEFT(), MID(), RIGHT() extract specific number of characters from the text
As the name suggests, 🎯 the function LEFT() extracts the specified number of characters of a text starting from the Left side or the start of the cell and the function RIGHT() extracts the specified number of characters of a text starting from the Right side or the end of the cell. All you need to provide is the cell number containing a text value and the number of characters you want to extract.
🎯 The function MID() extracts the specified number of characters of a text from anywhere in the middle. This can be used in the cases when you want to omit the first few characters from the selection. Here, you need to provide 1 more input. In addition to the cell number and number of characters you want, you should mention the start_number.
Here comes the syntax-
=MID(Text, start_number, number_of_characters)
And start_number = 1 + Number of characters you want to omit from start
Check out the below example for a clearer understanding,
You can quickly turn on or turn off the dropdowns and filters in the Excel dataset with Ctrl + Shift + L. Just select any cell in your dataset and hit this key trio to toggle the filters. This will save your time to go to the Data tab and search for the filter button.
Summing up,
The data is not always structured as per your needs and you need to do some calculation, text operations to make it well structured for your analysis 📊. In the actual data analysis process, you will try to find the aggregate values, statistics, discover some trends and occurrences of different values in the data set.
Whether you want to provide data-driven insights or contribute to decision making at higher levels or simply finish your work faster, mastering the right Excel functions will excel ⚡️ your productivity and save your time ⏰
Mastering the COUNTIFS(), VLOOKUP(), these aggregate and text functions will surely make your data analysis faster ⚡️ and life easier. Remember, the faster you analyze the data, the faster you transform the data into insights and more time to make decisions.
Interested to read something more into Data Analysis ??
Then have a look at my other articles:
towardsdatascience.com
towardsdatascience.com
towardsdatascience.com
Looking for something fun-n-learn ??
Here is a quick ⚡️ read to make your own data set with ready-to-use Python code.
towardsdatascience.com
Keep Learning! Keep Smiling! Stay Motivated!
medium.com
Thank you for reading and your time!
I use these techniques to speed-up ⚡️ my data analysis. I hope it helps you as well. As always, I am open to feedback and to know which other techniques you use for faster data analysis. The dataset for all the examples here is derived from the Dummy data set.
Feel free to add your feedback and connect with me on LinkedIn.