The Valuation of an early stage startup is basically a totally made up numbers pulled out of thin air (they probably have formulas and Excel sheets designed by very smart people but all the inputs to those formulas are guesses and estimates).
You are giving up a part of the company in exchange for some money, the valuation is used to decide how much of the company you are giving them, they say "your company is worth $X therefor we get Y% for $Z" - but since X is a total made up number you actually have "I've selling Y% of the company for $Z", so you should derive the valuation you are willing to accept from the amount of money you get and the percentage of the company you are willing to sell.
It's just like selling or buying any item that doesn't have an agreed upon price (and it is, you are basically selling a part of your company):
First you decide what is the valuation (based on investment amount and ownership percentage) you want to get and what is the worst valuation you are willing to accept.
In the second step you let the investor do the "black magic" and get their valuation.
Than you negotiate like a crazy - remember their number is based on what they want to pay and what they want to get, not on reality (just like your numbers are based on how desperate you are for investment and not on subjective "worth").
In the end if you agree on a number you make the deal, if their offer isn't good enough you walk away.
Also, remember this deal isn't dependent on a single number, every clause in every contract and term sheet can (and should be) negotiated.