Category Archive 'Excel function tutorials'

Gathering Financial Data in Excel With YCharts

Excel 2013, Excel function tutorials

One of the most requested subjects on this blog is getting financial information into Excel. The easiest way of course is having a Bloomberg terminal which makes it possible to access a seemingly unlimited amount of data about the economy, publicly listed companies, indexes, etc. The possibilities are incredible. Think there is a drawback? Of course. Given it has a financial professional target audience, the cost is typically between $1000-3000/month depending on the type of service you have, if you’re getting live prices, etc. Yes you read that right, it’s per month.

It seemed incredible to me that no one was trying to disrupt this market no matter how complex it is. I have written a few times about how it’s possible to get some financial data from Google finance in Google docs, cloud-based spreadsheets:

-Using Google Spreadsheets As An Alternative To Excel For Stock Prices And Information
-Managing A Stock Or ETF Portfolio From Google Docs
-How To Add Exchange Rates In Google Docs

There’s no doubt that those capabilities are very interesting and make it easy to track the value of a portfolio for example. What if you’re trying to do more though?

One clear candidate emerges: YCharts

Ycharts is a website where you can do a lot of what you’d do on a site like Yahoo finance or Google finance. You can build stock lists, look into a company’s financials, past statements, etc. The big difference is that if you join one of their paid memberships, you can get access to their very powerful excel plug-in. While not exactly Bloomberg, the possibilities with this spreadsheet are very very impressive. Look at how I’m using it personally:

I have a list of 300-400 stocks that are on my screener and represent potential purchases. I then have all of those stocks in a spreadsheet and look to get specific metrics such as market cap, price, dividend yield, P/E and some growth metrics with their custom formulas. For example, to get Blackrock’s dividend yield, I’d enter:


Every time I refresh my spreadsheet, I’ll get updated values. This is what this specific spreadsheet looks like:

They also provide templates that you can use to either look at many companies or at one in more details:

I’m guessing at this point i’ts starting to look like I was paid to write about this but I’m just a big fan of what they’re doing and have been a paying member for 6 months now.

Has anyone else given YCharts a try? If so, I’d love to get your thoughts.

Counting Number Of Unique Entries (CountIf Function)

Excel function tutorials

I received a question that made me think of something I had tried to do in a spreadsheet a few months ago but never got around to discuss on this blog. Suppose that you have a large set of data that looks like:

There are a large number of things that could be done with such a set of data but one always tricky aspect is getting answers to questions that involve multiple columns. For example, if someone were to ask you, how many different locations of the store sold at least 1 Early Grey Russian black tea box on each day? I cannot simply add up the number of sales since some stores sell multiple boxes. What could I do? I’ll add 2 columns and include the “countif” function which will give me my answer:)

First, I will create a column with a “UniqueID” with the concactenate:

Then, I will use the “countif” function to see if the ID is unique:

As you can see, all numbers that are “1” are non-Unique. I can then manipulate that column in different ways

As always, you can download the spreadsheet here:)

Nest if Functions – It’s All About Doing It Step By Step

Excel function tutorials

I often get these types of questions where someone is trying to do a nested if function but having trouble doing so. Here is one such example:

“I am trying to write a and/if statement to read if b2=”manager” and d2=”b” and h2

Is there some help someone could provide me with this?"

The only tricky part in doing this is splitting the problem into different parts and resolving those one at a time.

Basically here, I'm looking to see if:

-all 3 conditions are met - if so, display:

The first condition is:


The second condition is:


After nesting both together, my new formula would be:


Then, I'd add the final condition:


Simple enough? I'll then replace "1" by under:


Here is a file with such an example:

Doing An IRR function in Excel manually Using The Goal Seek Function

Excel function tutorials

The other day I got an interesting question from a reader. He was trying to do an IRR (internal rate of return) but had one specification. An IRR function assumes that all cash flows are at the same period of the year. He wanted something more precise that would account for the fact that some cash flows might be at the start, beginning or middle of the year. I suggested that he try to do an IRR manually and decided to give it a try myself.

First, take a look at a traditional IRR function result:

Then, I decided to get the same result but with a function instead. How?

An IRR function is the rate of return for break-even. So I created a formula manually that would calculate the “NAV”. When that NAV would become $0, I would have the correct IRR. Look at this screen:

Then, I used the goal seek function to set the nav to $0.

As you can see, I get the same result:

Then, I did the same exercise but changed the years to reflect the period. So Q1 of the 3rd year would become 2.25, etc. See the result here:

AverageIf Function Using Excel

Excel 2013, Excel function tutorials

I’ve heard from several of you that use Excel to manage large sets of data nad I know hata few of you must then get different metrics from that data depending on specific conditions. I’ve already covered Sumif quite a bit so today I thought I’d get into “averageif”. Let’s start with a large set of data:

This is an example of the top rankings in the WTA tennis tour. One typical thing that you could end up wanting to do is find information such as:

-What is the average # of tournaments that the top Russians have played compared with the top Americans. Here is How I would do it:

I’m certain that many of you can now imagine how this could be used.