How about this alternative way of measuring the 'value' of a company: Net asset value (including retained earnings) plus the sum of all dividends ever issued, minus total investment capital.
One could do equity value + discounted payouts - discounted invested capital. This includes payments on debt and possibly taxes.
This measure would not be a "value" in an economic sense as valuation is in present terms, incorporating future potential and using the past only to inform assumptions. This measure catalogs a company's time-integrated capital productivity. This could inform a valuation, but taking an extreme case, it would value dearly a shell company that just paid its assets out in a dividend.
With the subjectivity complexities like cross-border activity or M&A introduce the exercise has little value beyond the pedagogical.