Lets learn how to put multiple functions and formulas in a single cell in Excel in order to build more complex formulas that will, in the end, make your life easier.
This is called nesting and it simply means putting functions inside of functions.
All you have to do is start typing the function where you need it within another function. The basic concept that you need to understand is that you can put multiple functions within a single cell, inside of other functions (or next to other functions using concatenation - though concatenation is beyond the scope of this article).
The best way to exhibit this, and my first experience with it, is with Text Manipulation in Excel.
Lets say that you have the below example:
We want to get the first two characters from each part number so we use the =LEFT() function in Excel to get this:
BUT, there is a problem with another list of values because some of them have spaces in front of them, so our LEFT() function on its own will not return what we want:
Notice how for the first part number only "4" is returned when we want "4z". This is due to the space in front of the part number in cell B3. To solve this issue, we can nest functions; we can put another function inside the LEFT() function and this is as easy as typing the second function wherever we need it to work.
Since we want to get rid of the extra spaces around some of the part numbers, we want to use the TRIM() function and we want to trim the part numbers before the LEFT() function pulls the two characters from the left of the text. As such, we put the TRIM() function around the cell reference for the part numbers like this:
You can see how the TRIM() function is placed completely inside of the LEFT() function. That is all there is to it.
This is often used with the IF() function/statement in Excel to create more powerful logic statements.
This is one of the most under-used, yet one of the most important, features of Excel and it allows you to make very powerful and complex analysis of data very quickly.
You can nest many functions within a single cell, the number varies depending on your version, but a typical user will never reach that limit and, if you do, you are doing something wrong.
I hope this helps! :)