In the vast majority of cases, investors do value cash on a 1:1 basis. The reasons for not doing so:

(1) If the company is burning cash - This is self explanatory. Remember that the opposite is true as well - when arriving at the price target, investors will also give credit for any free cash flow (FCF) that they expect the company to generate over their holding period.

(2) If most of the cash is held overseas - Unless the US has a tax repatriation holiday, companies will face a "make-whole" tax bill based on the delta of the tax rate between the US and the foreign domicile. This is a big issue for large-cap tech companies that generate substantial cash overseas, but whose expenses / capital returns policies all use US cash. For example, Cisco has $51bn in cash, of which $46bn is held overseas. Cisco and most other companies facing this issue have publicly stated that they will not repatriate cash unless there is a tax holiday. They are generating enough free cash flow in the US where they have no need to. They could also raise domestic debt based on foreign cash balances to get around the need to repatriate. As a result, most investors do end up giving cash a 1:1 credit even in this scenario.

(3) If investors don't trust the management team's use of that cash - Cash is only valuable to equity investors in so far as it can eventually be returned to shareholders through share repurchases or dividends. Companies often get penalized if the management team has a history of using cash in inefficient ways - either investing in non-core / dilutive business adjacencies, or value-destructive acquisitions. Zynga is the perfect example here - the bull thesis on Zynga when it was trading at $2.50 was that the company was trading at cash value. The bears on the other hand felt uncomfortable giving Zynga full value for the cash because the management team had acquired a number of gaming studios (e.g. OMGPOP) that did not provide any long-term contribution and were eventually shut down.

Long story short, in most circumstances, you should operate under the assumption that investors are giving a company 1:1 credit for cash. What they're actually discounting is the denominator - the earnings if you're using a P/E multiple, or the EBITDA if you're using an EV / EBITDA multiple. They're betting that the projected earnings power of the company is overly optimistic. That's actually a double whammy - valuation multiples are dependent on growth rates, i.e. higher growth results in a higher multiple. If the denominator falls, the growth rate is lower, and thus the multiple contracts as well. Most retail investors fail to understand that a slight decrease in the denominator actually has a much larger impact on the valuation.

The case of Yahoo is a bit unique, but related to #2 above. The market is implying that Yahoo won't be able to liquidate it's Alibaba stake in a tax-efficient manner and will thus end up paying 20-35% taxes. Happy to run you through the full math, but after you account for taxes, you're paying ~5-6x EBITDA for a business growing single digits y/y. Arguably Google is a more tempting investment opportunity - it's trading at roughly the same multiple, but growing double digits y/y.