# Terrible newbe question

I’ve got a zombie brain for these things, if anyone could guide me in the right direction that would be great.

I have my variables: Price, Dividend & total
So when I type in a Price and a Dividend number, I want to calculate how many stocks I need to buy to earn 100 in yearly yield, which is my total variable**.**

So I figure I do pricePerStock=dividendyield1 so then I have a yield per single stock…now how do I figure out whats left to 100. I’m so lost I can’t even explain what I want I guess.

Basically I want to know how many stocks I need to purchase to get 100 in the end.

You begin with the price and dividend data?

dividendPerStock / stockPrice gives you dividendYield.
e.g. a 10\$ dividend for a share priced at 100\$ gives you a 0.1 dividendYield.

Then, simply do 100 / dividendYield and it’ll give you the amount you need to spend on shares.

Can do that amount / stockPrice to get the amount of shares needed.

Did I get you right?

I solved it. Thank you for the reply.